Browse Source

Add additional test coverage for optional columns

Add more tests for generating optional boolean column definitions.

Refs #9686
Mark Story 9 years ago
parent
commit
e0501ddb27

+ 10 - 0
tests/TestCase/Database/Schema/MysqlSchemaTest.php

@@ -633,9 +633,19 @@ SQL;
             ],
             [
                 'checked',
+                ['type' => 'boolean', 'default' => false, 'null' => false],
+                '`checked` BOOLEAN NOT NULL DEFAULT FALSE'
+            ],
+            [
+                'checked',
                 ['type' => 'boolean', 'default' => true, 'null' => false],
                 '`checked` BOOLEAN NOT NULL DEFAULT TRUE'
             ],
+            [
+                'checked',
+                ['type' => 'boolean', 'default' => false, 'null' => true],
+                '`checked` BOOLEAN DEFAULT FALSE'
+            ],
             // datetimes
             [
                 'created',

+ 1 - 1
tests/TestCase/Database/Schema/SqliteSchemaTest.php

@@ -552,7 +552,7 @@ SQL;
             // Boolean
             [
                 'checked',
-                ['type' => 'boolean', 'default' => false],
+                ['type' => 'boolean', 'null' => true, 'default' => false],
                 '"checked" BOOLEAN DEFAULT FALSE'
             ],
             [