Advisor: mark that 'Rate of reading fixed position' may be wrong, requires further...
[phpmyadmin/thilanka.git] / test / libraries / common / PMA_extractFieldSpec_test.php
blobeeb79c4cd0ff7c1b7edabd9ffd80e90d905e8de1
2 <?php
3 /* vim: set expandtab sw=4 ts=4 sts=4: */
4 /**
5 * Test for PMA_extractFieldSpec from common.lib.php
7 * @package phpMyAdmin-test
8 * @group common.lib-tests
9 */
12 * Include to test.
14 require_once 'libraries/common.lib.php';
16 /**
17 * Test for PMA_extractFieldSpec function.
19 class PMA_extractFieldSpec_test extends PHPUnit_Extensions_OutputTestCase
21 /**
22 * Test case for parsing SHOW COLUMNS output
24 * @dataProvider provider
26 public function testParsing($in, $out)
28 $this->assertEquals($out, PMA_extractFieldSpec($in));
31 /**
32 * Data provider
34 * @return array
36 public function provider()
38 return array(
39 array(
40 "SET('a','b')",
41 array(
42 'type' => 'set',
43 'print_type' => "set('a', 'b')",
44 'binary' => false,
45 'unsigned' => false,
46 'zerofill' => false,
47 'spec_in_brackets' => "'a','b'",
48 'enum_set_values' => array('a', 'b'),
49 'attribute' => ' ',
52 array(
53 "SET('\'a','b')",
54 array(
55 'type' => 'set',
56 'print_type' => "set('\'a', 'b')",
57 'binary' => false,
58 'unsigned' => false,
59 'zerofill' => false,
60 'spec_in_brackets' => "'\'a','b'",
61 'enum_set_values' => array("'a", 'b'),
62 'attribute' => ' ',
65 array(
66 "SET('''a','b')",
67 array(
68 'type' => 'set',
69 'print_type' => "set('''a', 'b')",
70 'binary' => false,
71 'unsigned' => false,
72 'zerofill' => false,
73 'spec_in_brackets' => "'''a','b'",
74 'enum_set_values' => array("'a", 'b'),
75 'attribute' => ' ',
78 array(
79 "INT UNSIGNED zerofill",
80 array(
81 'type' => 'int unsigned zerofill',
82 'print_type' => 'int',
83 'binary' => false,
84 'unsigned' => true,
85 'zerofill' => true,
86 'spec_in_brackets' => '',
87 'enum_set_values' => array(),
88 'attribute' => 'UNSIGNED ZEROFILL',
91 array(
92 "VARCHAR(255)",
93 array(
94 'type' => 'varchar',
95 'print_type' => 'varchar(255)',
96 'binary' => false,
97 'unsigned' => false,
98 'zerofill' => false,
99 'spec_in_brackets' => '255',
100 'enum_set_values' => array(),
101 'attribute' => ' ',
104 array(
105 "VARBINARY(255)",
106 array(
107 'type' => 'varbinary',
108 'print_type' => 'varbinary(255)',
109 'binary' => false,
110 'unsigned' => false,
111 'zerofill' => false,
112 'spec_in_brackets' => '255',
113 'enum_set_values' => array(),
114 'attribute' => ' ',