Physikerwelt has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/189356

Change subject: Move debug integration test to special-page
......................................................................

Move debug integration test to special-page

Since all other LaTexML integration tests will be performed
from the math status special page, it seems reasonable to
run the debug tests from this specialpage as well.

Change-Id: I47c405dbe16c2585907b9f67cdc01ed76e51892a
---
M SpecialMathStatus.php
1 file changed, 24 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Math 
refs/changes/56/189356/1

diff --git a/SpecialMathStatus.php b/SpecialMathStatus.php
index 39cb34d..6ee4c50 100644
--- a/SpecialMathStatus.php
+++ b/SpecialMathStatus.php
@@ -51,8 +51,12 @@
        }
 
        private function runMathLaTeXMLTest( $modeName ) {
+               global $wgMathDebug;
                $this->getOutput()->addWikiMsgArray( 'math-test-start', 
$modeName );
                $this->testMathMLIntegration();
+               if ( $wgMathDebug ){
+                       $this->testDebug();
+               }
                $this->getOutput()->addWikiMsgArray( 'math-test-end', $modeName 
);
        }
 
@@ -120,6 +124,26 @@
                          $renderer->getLastError() );
        }
 
+       /**
+        * Checks the creation of the math table with debugging enabled.
+        * @covers MathHooks::onLoadExtensionSchemaUpdates
+        */
+       public function testDebug() {
+               $dbr = wfGetDB( DB_SLAVE );
+               if ( $dbr->getType() !== 'mysql' ) {
+                       $this->getOutput()->addWikiText( 'Debug columns not 
supported in ' . $dbr->getType() );
+                       return;
+               }
+               $renderer = MathRenderer::getRenderer( "a+b", array(), 
MW_MATH_MATHML );
+               $this->assertTrue( $renderer->render( true ) );
+               $hash = $renderer->getInputHash();
+               $row = $dbr->selectRow("mathlog", "*", array( "math_inputhash" 
=> $hash ) , __METHOD__,
+                       array("order by" => "math_timestamp desc"));
+               $this->assertContains( "success", $row->math_log );
+               $this->assertEquals( 
"type=inline-TeX&q=%7B%5Cdisplaystyle%20a%2Bb%7D", $row->math_post );
+               $this->assertEquals( 5, $row->math_mode);
+       }
+
        private function assertTrue( $expression, $message = '' ) {
                if ( $expression ){
                        $this->getOutput()->addWikiMsgArray( 
'math-test-success' , $message );

-- 
To view, visit https://gerrit.wikimedia.org/r/189356
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I47c405dbe16c2585907b9f67cdc01ed76e51892a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Math
Gerrit-Branch: debug
Gerrit-Owner: Physikerwelt <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to