diff --git a/tests/Provider/CommandProvider.php b/tests/Provider/CommandProvider.php index 70326b2bc..8d5035f71 100644 --- a/tests/Provider/CommandProvider.php +++ b/tests/Provider/CommandProvider.php @@ -22,14 +22,14 @@ public static function batchInsert(): array { $batchInsert = parent::batchInsert(); - $batchInsert['multirow']['expectedParams'][':qp3'] = 1; - $batchInsert['multirow']['expectedParams'][':qp7'] = 0; + $batchInsert['multirow']['expectedParams'][':qp3'] = true; + $batchInsert['multirow']['expectedParams'][':qp7'] = false; - $batchInsert['issue11242']['expectedParams'][':qp3'] = 1; + $batchInsert['issue11242']['expectedParams'][':qp3'] = true; - $batchInsert['wrongBehavior']['expectedParams'][':qp3'] = 0; + $batchInsert['wrongBehavior']['expectedParams'][':qp3'] = false; - $batchInsert['batchInsert binds params from expression']['expectedParams'][':qp3'] = 0; + $batchInsert['batchInsert binds params from expression']['expectedParams'][':qp3'] = false; return $batchInsert; } diff --git a/tests/Provider/QueryBuilderProvider.php b/tests/Provider/QueryBuilderProvider.php index aea94267a..21c71be3f 100644 --- a/tests/Provider/QueryBuilderProvider.php +++ b/tests/Provider/QueryBuilderProvider.php @@ -128,7 +128,7 @@ public static function insertWithReturningPks(): array ['{{%type}}.[[related_id]]' => null, '[[time]]' => new Expression('now()')], [], << null], ], diff --git a/tests/Provider/SchemaProvider.php b/tests/Provider/SchemaProvider.php index 039aa5c17..fd8b8ac6a 100644 --- a/tests/Provider/SchemaProvider.php +++ b/tests/Provider/SchemaProvider.php @@ -171,9 +171,9 @@ public static function columns(): array 'defaultValue' => '2002-01-01 00:00:00', ], 'bool_col' => [ - 'type' => 'tinyint', - 'dbType' => 'tinyint', - 'phpType' => 'integer', + 'type' => 'boolean', + 'dbType' => 'bit', + 'phpType' => 'boolean', 'primaryKey' => false, 'allowNull' => false, 'autoIncrement' => false, @@ -184,9 +184,9 @@ public static function columns(): array 'defaultValue' => null, ], 'bool_col2' => [ - 'type' => 'tinyint', - 'dbType' => 'tinyint', - 'phpType' => 'integer', + 'type' => 'boolean', + 'dbType' => 'bit', + 'phpType' => 'boolean', 'primaryKey' => false, 'allowNull' => true, 'autoIncrement' => false, @@ -194,7 +194,7 @@ public static function columns(): array 'size' => null, 'precision' => null, 'scale' => null, - 'defaultValue' => 1, + 'defaultValue' => true, ], ], 'tableName' => 'type', diff --git a/tests/Provider/Type/BitProvider.php b/tests/Provider/Type/BitProvider.php index 4b28ae78c..adddfe5d5 100644 --- a/tests/Provider/Type/BitProvider.php +++ b/tests/Provider/Type/BitProvider.php @@ -9,9 +9,9 @@ final class BitProvider public static function columns(): array { return [ - ['Mybit1', 'bit', 'integer', 0], - ['Mybit2', 'bit', 'integer', 1], - ['Mybit3', 'bit', 'integer', 2], + ['Mybit1', 'bit', 'boolean', false], + ['Mybit2', 'bit', 'boolean', true], + ['Mybit3', 'bit', 'boolean', true], ]; } } diff --git a/tests/Type/BitTest.php b/tests/Type/BitTest.php index 2b5141ef3..36bcdfc77 100644 --- a/tests/Type/BitTest.php +++ b/tests/Type/BitTest.php @@ -37,7 +37,7 @@ public function testCreateTableWithDefaultValue( string $column, string $dbType, string $phpType, - int $defaultValue + bool $defaultValue ): void { $db = $this->buildTable(); @@ -89,7 +89,7 @@ public function testDefaultValue( string $column, string $dbType, string $phpType, - int $defaultValue + bool $defaultValue ): void { $this->setFixture('Type/bit.sql'); @@ -198,7 +198,7 @@ public function testMaxValue(): void $this->assertSame( [ 'id' => '2', - 'Mybit1' => '0', + 'Mybit1' => '1', 'Mybit2' => '1', 'Mybit3' => '1', ], @@ -251,7 +251,7 @@ public function testMinValue(): void [ 'id' => '2', 'Mybit1' => null, - 'Mybit2' => '0', + 'Mybit2' => '1', 'Mybit3' => '1', ], $command->setSql(