Drizzle-compatible Status tab
[phpmyadmin-regexreplace.git] / test / PMA_SQL_parser_data_test.php
blob45fa07cb734d19cb8253d6375f0675cca3840e31
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
4 * tests for correctness of SQL parser data
6 * @package phpMyAdmin-test
7 */
9 /**
10 * Tests core.
12 require_once 'PHPUnit/Framework.php';
14 define('PHPMYADMIN', 1);
16 /**
17 * Include to test.
19 require_once './libraries/sqlparser.data.php';
21 /**
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)
30 $copy = $array;
31 sort($copy);
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');