From e6bd28ea880bfa7b3b941efcb6b4bb54f12f9227 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Mon, 30 Aug 2010 15:22:49 +0200 Subject: [PATCH] Test counts as well. --- test/PMA_SQL_parser_data_test.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/test/PMA_SQL_parser_data_test.php b/test/PMA_SQL_parser_data_test.php index e8271639c..45fa07cb7 100644 --- a/test/PMA_SQL_parser_data_test.php +++ b/test/PMA_SQL_parser_data_test.php @@ -33,29 +33,35 @@ class PMA_SQL_parser_data_test extends PHPUnit_Framework_TestCase $this->assertEquals($difference, array()); } + private function assertParserData($name) + { + $this->assertSorted($GLOBALS[$name]); + $this->assertEquals(count($GLOBALS[$name]), $GLOBALS[$name . '_cnt']); + } + public function testPMA_SQPdata_function_name() { - $this->assertSorted($GLOBALS['PMA_SQPdata_function_name']); + $this->assertParserData('PMA_SQPdata_function_name'); } public function testPMA_SQPdata_column_attrib() { - $this->assertSorted($GLOBALS['PMA_SQPdata_column_attrib']); + $this->assertParserData('PMA_SQPdata_column_attrib'); } public function testPMA_SQPdata_reserved_word() { - $this->assertSorted($GLOBALS['PMA_SQPdata_reserved_word']); + $this->assertParserData('PMA_SQPdata_reserved_word'); } public function testPMA_SQPdata_forbidden_word() { - $this->assertSorted($GLOBALS['PMA_SQPdata_forbidden_word']); + $this->assertParserData('PMA_SQPdata_forbidden_word'); } public function testPMA_SQPdata_column_type() { - $this->assertSorted($GLOBALS['PMA_SQPdata_column_type']); + $this->assertParserData('PMA_SQPdata_column_type'); } }