Skip to content

Commit

Permalink
Improve tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Oct 24, 2023
1 parent 543959c commit 54d26bf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions tests/framework/db/mssql/type/BooleanTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function testBoolean(): void

// test php typecast
$phpTypeCast = $column->phpTypecast($boolValue);
$this->assertSame(false, $phpTypeCast);
$this->assertFalse($phpTypeCast);

// test value 1
$db->createCommand()->insert($tableName, ['bool_col' => 1])->execute();
Expand All @@ -56,7 +56,7 @@ public function testBoolean(): void

// test php typecast
$phpTypeCast = $column->phpTypecast($boolValue);
$this->assertSame(true, $phpTypeCast);
$this->assertTrue($phpTypeCast);

// test value `false`
$db->createCommand()->insert($tableName, ['bool_col' => false])->execute();
Expand All @@ -65,7 +65,7 @@ public function testBoolean(): void

// test php typecast
$phpTypeCast = $column->phpTypecast($boolValue);
$this->assertSame(false, $phpTypeCast);
$this->assertFalse($phpTypeCast);

// test value `true`
$db->createCommand()->insert($tableName, ['bool_col' => true])->execute();
Expand All @@ -74,11 +74,12 @@ public function testBoolean(): void

// test php typecast
$phpTypeCast = $column->phpTypecast($boolValue);
$this->assertSame(true, $phpTypeCast);
$this->assertTrue($phpTypeCast);

// test value `null`
$db->createCommand()->insert($tableName, ['bool_col' => null])->execute();
$boolValue = $db->createCommand("SELECT bool_col FROM $tableName WHERE id = 5")->queryScalar();
$this->assertNull($boolValue);

// test php typecast
$phpTypeCast = $column->phpTypecast($boolValue);
Expand Down

0 comments on commit 54d26bf

Please sign in to comment.