diff --git a/test/classes/PMA_Error_test.php b/test/classes/PMA_Error_test.php new file mode 100644 index 000000000000..518a4e369f0e --- /dev/null +++ b/test/classes/PMA_Error_test.php @@ -0,0 +1,105 @@ +object = $this->getMockForAbstractClass('PMA_Error', array('2', 'Compile Error', 'error.txt', 15)); + } + + /** + * Tears down the fixture, for example, closes a network connection. + * This method is called after a test is executed. + * + * @access protected + * @return void + */ + protected function tearDown() + { + unset($this->object); + } + + /** + * Test for setBacktrace + */ + public function testSetBacktrace(){ + $this->object->setBacktrace(array('bt1','bt2')); + $this->assertEquals($this->object->getBacktrace(),array('bt1','bt2')); + } + + /** + * Test for setLine + */ + public function testSetLine(){ + $this->object->setLine(15); + $this->assertEquals($this->object->getLine(),15); + } + + /** + * Test for setFile + */ + public function testSetFile(){ + $this->object->setFile('/var/www/pma.txt'); + $this->assertEquals($this->object->getFile(),'./../../..'); + } + + /** + * Test for getHash + */ + public function testGetHash(){ + $this->assertEquals(1, preg_match('/^([a-z0-9]*)$/', $this->object->getHash())); + } + + /** + * Test for getBacktraceDisplay + */ + public function testGetBacktraceDisplay(){ + $this->assertTrue((strpos($this->object->getBacktraceDisplay(),'/usr/share/php/PHPUnit/Framework/TestCase.php#751: PHPUnit_Framework_TestResult->run(object)
') !== false)); + } + + /** + * Test for getDisplay + */ + public function testGetDisplay(){ + $this->assertTrue((strpos($this->object->getDisplay(),'
Warning') !== false)); + } + + /** + * Test for getHtmlTitle + */ + public function testGetHtmlTitle(){ + $this->assertEquals($this->object->getHtmlTitle(),'Warning: Compile Error'); + } + + /** + * Test for getTitle + */ + public function testGetTitle(){ + $this->assertEquals($this->object->getTitle(),'Warning: Compile Error'); + } +} diff --git a/test/classes/PMA_Message_test.php b/test/classes/PMA_Message_test.php index d95594e65a96..19db79edfd5a 100644 --- a/test/classes/PMA_Message_test.php +++ b/test/classes/PMA_Message_test.php @@ -479,7 +479,7 @@ public function providerAffectedRows() return array( array(1, '
1 row affected.
'), array(2, '
2 rows affected.
'), - array(50000000000000, '
50000000000000 rows affected.
'), + array(10000, '
10000 rows affected.
'), ); } @@ -505,7 +505,7 @@ public function providerInsertedRows() return array( array(1, '
1 row inserted.
'), array(2, '
2 rows inserted.
'), - array(50000000000000, '
50000000000000 rows inserted.
'), + array(100000, '
100000 rows inserted.
'), ); } @@ -531,7 +531,7 @@ public function providerDeletedRows() return array( array(1, '
1 row deleted.
'), array(2, '
2 rows deleted.
'), - array(50000000000000, '
50000000000000 rows deleted.
'), + array(500000, '
500000 rows deleted.
'), ); }