Skip to content

Commit

Permalink
Update tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Oct 25, 2023
1 parent 0ce3b21 commit 7e6b94e
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
10 changes: 5 additions & 5 deletions tests/Provider/CommandProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Provider/QueryBuilderProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public static function insertWithReturningPks(): array
['{{%type}}.[[related_id]]' => null, '[[time]]' => new Expression('now()')],
[],
<<<SQL
SET NOCOUNT ON;DECLARE @temporary_inserted TABLE ([int_col] int , [int_col2] int NULL, [tinyint_col] tinyint NULL, [smallint_col] smallint NULL, [char_col] char(100) , [char_col2] varchar(100) NULL, [char_col3] text NULL, [float_col] decimal(4,3) , [float_col2] float NULL, [blob_col] varbinary(MAX) NULL, [numeric_col] decimal(5,2) NULL, [datetime_col] datetime , [bool_col] tinyint , [bool_col2] tinyint NULL);INSERT INTO {{%type}} ([related_id], [time]) OUTPUT INSERTED.[int_col],INSERTED.[int_col2],INSERTED.[tinyint_col],INSERTED.[smallint_col],INSERTED.[char_col],INSERTED.[char_col2],INSERTED.[char_col3],INSERTED.[float_col],INSERTED.[float_col2],INSERTED.[blob_col],INSERTED.[numeric_col],INSERTED.[datetime_col],INSERTED.[bool_col],INSERTED.[bool_col2] INTO @temporary_inserted VALUES (:qp0, now());SELECT * FROM @temporary_inserted;
SET NOCOUNT ON;DECLARE @temporary_inserted TABLE ([int_col] int , [int_col2] int NULL, [tinyint_col] tinyint NULL, [smallint_col] smallint NULL, [char_col] char(100) , [char_col2] varchar(100) NULL, [char_col3] text NULL, [float_col] decimal(4,3) , [float_col2] float NULL, [blob_col] varbinary(MAX) NULL, [numeric_col] decimal(5,2) NULL, [datetime_col] datetime , [bool_col] bit , [bool_col2] bit NULL);INSERT INTO {{%type}} ([related_id], [time]) OUTPUT INSERTED.[int_col],INSERTED.[int_col2],INSERTED.[tinyint_col],INSERTED.[smallint_col],INSERTED.[char_col],INSERTED.[char_col2],INSERTED.[char_col3],INSERTED.[float_col],INSERTED.[float_col2],INSERTED.[blob_col],INSERTED.[numeric_col],INSERTED.[datetime_col],INSERTED.[bool_col],INSERTED.[bool_col2] INTO @temporary_inserted VALUES (:qp0, now());SELECT * FROM @temporary_inserted;
SQL,
[':qp0' => null],
],
Expand Down
14 changes: 7 additions & 7 deletions tests/Provider/SchemaProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -184,17 +184,17 @@ 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,
'enumValues' => [],
'size' => null,
'precision' => null,
'scale' => null,
'defaultValue' => 1,
'defaultValue' => true,
],
],
'tableName' => 'type',
Expand Down
6 changes: 3 additions & 3 deletions tests/Provider/Type/BitProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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],
];
}
}
8 changes: 4 additions & 4 deletions tests/Type/BitTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function testCreateTableWithDefaultValue(
string $column,
string $dbType,
string $phpType,
int $defaultValue
bool $defaultValue
): void {
$db = $this->buildTable();

Expand Down Expand Up @@ -89,7 +89,7 @@ public function testDefaultValue(
string $column,
string $dbType,
string $phpType,
int $defaultValue
bool $defaultValue
): void {
$this->setFixture('Type/bit.sql');

Expand Down Expand Up @@ -198,7 +198,7 @@ public function testMaxValue(): void
$this->assertSame(
[
'id' => '2',
'Mybit1' => '0',
'Mybit1' => '1',
'Mybit2' => '1',
'Mybit3' => '1',
],
Expand Down Expand Up @@ -251,7 +251,7 @@ public function testMinValue(): void
[
'id' => '2',
'Mybit1' => null,
'Mybit2' => '0',
'Mybit2' => '1',
'Mybit3' => '1',
],
$command->setSql(
Expand Down

0 comments on commit 7e6b94e

Please sign in to comment.