2 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 * tests for correctness of SQL parser data
6 * @package phpMyAdmin-test
12 require_once 'PHPUnit/Framework.php';
14 define('PHPMYADMIN', 1);
19 require_once './libraries/sqlparser.data.php';
22 * Test for sorting of the arrays
24 * @package phpMyAdmin-test
26 class PMA_SQL_parser_data_test
extends PHPUnit_Framework_TestCase
28 private function assertSorted($array)
32 $difference = array_diff_assoc($array, $copy);
33 $this->assertEquals($difference, array());
36 private function assertParserData($name)
38 $this->assertSorted($GLOBALS[$name]);
39 $this->assertEquals(count($GLOBALS[$name]), $GLOBALS[$name . '_cnt']);
42 public function testPMA_SQPdata_function_name()
44 $this->assertParserData('PMA_SQPdata_function_name');
47 public function testPMA_SQPdata_column_attrib()
49 $this->assertParserData('PMA_SQPdata_column_attrib');
52 public function testPMA_SQPdata_reserved_word()
54 $this->assertParserData('PMA_SQPdata_reserved_word');
57 public function testPMA_SQPdata_forbidden_word()
59 $this->assertParserData('PMA_SQPdata_forbidden_word');
62 public function testPMA_SQPdata_column_type()
64 $this->assertParserData('PMA_SQPdata_column_type');