Physikerwelt has uploaded a new change for review.

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


Change subject: MathRender test
......................................................................

MathRender test

Testcase for the abstract MathRender class. Basically test the database access 
in a first step.

Change-Id: Ibafcd04fe3948477beab1aa8f4c8ef78f8af8084
---
A tests/MathRendererTest.php
1 file changed, 31 insertions(+), 0 deletions(-)


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

diff --git a/tests/MathRendererTest.php b/tests/MathRendererTest.php
new file mode 100644
index 0000000..b44a4ea
--- /dev/null
+++ b/tests/MathRendererTest.php
@@ -0,0 +1,31 @@
+<?php
+/**
+ * Test the database access and core functionallity of MathRenderer.
+ * 
+ * @group Math
+ */
+class MathRendererTest extends MediaWikiTestCase {
+
+       protected function setUp() {
+               parent::setUp();
+               //TODO:figure out why this is neccessary
+               $this->db= wfGetDB( DB_SLAVE );
+               //self::setupTestDB($this->db,"_test_math_");
+               //$this->tablesUsed[] = 'math';
+       
+       }
+       function addDBData() {
+               $this->tablesUsed[] = 'math';
+       }
+       /**
+        * Checks the basic functionallity
+        * i.e. if the span element is generated right.
+        */
+       public function testBasics(){
+               $real=MathRenderer::getRenderer("a+b",array(),MW_MATH_SOURCE);
+               $this->assertEquals('a+b', $real->getTex() , "test getTex");
+               $expectedhash=$this->db->encodeBlob( pack( "H32", md5( 'a+b' ) 
) );
+               $this->assertEquals($expectedhash,$real->getInputHash());
+       }
+
+}
\ No newline at end of file

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

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

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

Reply via email to