@@ -101,6 +101,38 @@ public function testBuild2()
101101 );
102102 }
103103
104+ public function testBuild3 ()
105+ {
106+ $ parser = new Parser (
107+ 'DROP TABLE IF EXISTS `searches`; '
108+ . 'CREATE TABLE `searches` ( '
109+ . ' `id` int(10) unsigned NOT NULL AUTO_INCREMENT, '
110+ . ' `name` varchar(255) COLLATE utf8_unicode_ci NOT NULL, '
111+ . ' `public_name` varchar(120) COLLATE utf8_unicode_ci NOT NULL, '
112+ . ' `group_id` smallint(5) unsigned NOT NULL DEFAULT \'0 \', '
113+ . ' `shortdesc` tinytext COLLATE utf8_unicode_ci, '
114+ . ' `show_separators` tinyint(1) NOT NULL DEFAULT \'0 \', '
115+ . ' `show_separators_two` tinyint(1) NOT NULL DEFAULT FALSE, '
116+ . ' `deleted` tinyint(1) NOT NULL DEFAULT \'0 \', '
117+ . ' PRIMARY KEY (`id`) '
118+ . ') ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci ; '
119+ . ''
120+ . 'ALTER TABLE `searches` ADD `admins_only` BOOLEAN NOT NULL DEFAULT FALSE AFTER `show_separators`; '
121+ );
122+ $ this ->assertEquals (
123+ '`public_name` varchar(120) COLLATE utf8_unicode_ci NOT NULL ' ,
124+ CreateDefinition::build ($ parser ->statements [1 ]->fields [2 ])
125+ );
126+ $ this ->assertEquals (
127+ '`show_separators` tinyint(1) NOT NULL DEFAULT \'0 \'' ,
128+ CreateDefinition::build ($ parser ->statements [1 ]->fields [5 ])
129+ );
130+ $ this ->assertEquals (
131+ '`show_separators_two` tinyint(1) NOT NULL DEFAULT FALSE ' ,
132+ CreateDefinition::build ($ parser ->statements [1 ]->fields [6 ])
133+ );
134+ }
135+
104136 public function testBuildWithInvisibleKeyword ()
105137 {
106138 $ parser = new Parser (
0 commit comments