3 /* vim: set expandtab sw=4 ts=4 sts=4: */
5 * Test for PMA_extractFieldSpec from common.lib.php
7 * @package phpMyAdmin-test
8 * @group common.lib-tests
14 require_once 'libraries/common.lib.php';
17 * Test for PMA_extractFieldSpec function.
19 class PMA_extractFieldSpec_test
extends PHPUnit_Extensions_OutputTestCase
22 * Test case for parsing SHOW COLUMNS output
24 * @dataProvider provider
26 public function testParsing($in, $out)
28 $this->assertEquals($out, PMA_extractFieldSpec($in));
36 public function provider()
43 'print_type' => "set('a', 'b')",
47 'spec_in_brackets' => "'a','b'",
48 'enum_set_values' => array('a', 'b'),
56 'print_type' => "set('\'a', 'b')",
60 'spec_in_brackets' => "'\'a','b'",
61 'enum_set_values' => array("'a", 'b'),
69 'print_type' => "set('''a', 'b')",
73 'spec_in_brackets' => "'''a','b'",
74 'enum_set_values' => array("'a", 'b'),
79 "INT UNSIGNED zerofill",
81 'type' => 'int unsigned zerofill',
82 'print_type' => 'int',
86 'spec_in_brackets' => '',
87 'enum_set_values' => array(),
88 'attribute' => 'UNSIGNED ZEROFILL',
95 'print_type' => 'varchar(255)',
99 'spec_in_brackets' => '255',
100 'enum_set_values' => array(),
107 'type' => 'varbinary',
108 'print_type' => 'varbinary(255)',
112 'spec_in_brackets' => '255',
113 'enum_set_values' => array(),