diff --git a/test/classes/PMA_DisplayResults_test.php b/test/classes/PMA_DisplayResults_test.php index e1c1be64f0..819e76aa50 100644 --- a/test/classes/PMA_DisplayResults_test.php +++ b/test/classes/PMA_DisplayResults_test.php @@ -352,7 +352,7 @@ class PMA_DisplayResults_test extends PHPUnit_Framework_TestCase } /** - * @return array array data for testGetTableNavigation + * @return array data for testGetTableNavigation */ public function providerForTestGetTableNavigation() { diff --git a/test/classes/PMA_Footer_test.php b/test/classes/PMA_Footer_test.php new file mode 100644 index 0000000000..6f02445086 --- /dev/null +++ b/test/classes/PMA_Footer_test.php @@ -0,0 +1,167 @@ +object = $this->getMockForAbstractClass('PMA_Footer'); + } + + /** + * 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); + } + + /** + * Call private functions by making the visibitlity to public. + * + * @param string $name method name + * @param array $params parameters for the invocation + * + * @return the output from the private method. + */ + private function _callPrivateFunction($name, $params) + { + $class = new ReflectionClass('PMA_Footer'); + $method = $class->getMethod($name); + $method->setAccessible(true); + return $method->invokeArgs($this->object, $params); + } + + /** + * Test for _getDebugMessage + */ + public function testGetDebugMessage(){ + + $_SESSION['debug']['queries'] = array('SELECT * FROM `pma_bookmark` WHERE 1', 'SELECT * FROM `db` WHERE 1'); + + $this->assertEquals( + $this->_callPrivateFunction( + '_getDebugMessage', + array() + ), + '
Array +( + [queries] => Array + ( + [0] => SELECT * FROM `pma_bookmark` WHERE 1 + [1] => SELECT * FROM `db` WHERE 1 + ) + +) +