-
-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #207: fix bool typecasting in SQLite
- Loading branch information
Showing
6 changed files
with
101 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
tests/Database/Functional/Driver/Common/Schema/BooleanColumnTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Cycle\Database\Tests\Functional\Driver\Common\Schema; | ||
|
||
use Cycle\Database\Tests\Functional\Driver\Common\BaseTest; | ||
|
||
abstract class BooleanColumnTest extends BaseTest | ||
{ | ||
public function testBooleanSchema(): void | ||
{ | ||
$schema = $this->schema('table'); | ||
|
||
$schema->boolean('column'); | ||
$schema->save(); | ||
$this->assertSameAsInDB($schema); | ||
} | ||
|
||
public function testBooleanAbstractType(): void | ||
{ | ||
$schema = $this->schema('table'); | ||
|
||
$schema->boolean('column'); | ||
$schema->save(); | ||
|
||
$column = $this->fetchSchema($schema)->column('column'); | ||
|
||
$this->assertSame('boolean', $column->getAbstractType()); | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
tests/Database/Functional/Driver/MySQL/Schema/BooleanColumnTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Cycle\Database\Tests\Functional\Driver\MySQL\Schema; | ||
|
||
// phpcs:ignore | ||
use Cycle\Database\Tests\Functional\Driver\Common\Schema\BooleanColumnTest as CommonClass; | ||
|
||
/** | ||
* @group driver | ||
* @group driver-mysql | ||
*/ | ||
class BooleanColumnTest extends CommonClass | ||
{ | ||
public const DRIVER = 'mysql'; | ||
} |
17 changes: 17 additions & 0 deletions
17
tests/Database/Functional/Driver/Postgres/Schema/BooleanColumnTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Cycle\Database\Tests\Functional\Driver\Postgres\Schema; | ||
|
||
// phpcs:ignore | ||
use Cycle\Database\Tests\Functional\Driver\Common\Schema\BooleanColumnTest as CommonClass; | ||
|
||
/** | ||
* @group driver | ||
* @group driver-postgres | ||
*/ | ||
final class BooleanColumnTest extends CommonClass | ||
{ | ||
public const DRIVER = 'postgres'; | ||
} |
17 changes: 17 additions & 0 deletions
17
tests/Database/Functional/Driver/SQLServer/Schema/BooleanColumnTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Cycle\Database\Tests\Functional\Driver\SQLServer\Schema; | ||
|
||
// phpcs:ignore | ||
use Cycle\Database\Tests\Functional\Driver\Common\Schema\BooleanColumnTest as CommonClass; | ||
|
||
/** | ||
* @group driver | ||
* @group driver-sqlserver | ||
*/ | ||
class BooleanColumnTest extends CommonClass | ||
{ | ||
public const DRIVER = 'sqlserver'; | ||
} |
17 changes: 17 additions & 0 deletions
17
tests/Database/Functional/Driver/SQLite/Schema/BooleanColumnTest.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Cycle\Database\Tests\Functional\Driver\SQLite\Schema; | ||
|
||
// phpcs:ignore | ||
use Cycle\Database\Tests\Functional\Driver\Common\Schema\BooleanColumnTest as CommonClass; | ||
|
||
/** | ||
* @group driver | ||
* @group driver-sqlite | ||
*/ | ||
class BooleanColumnTest extends CommonClass | ||
{ | ||
public const DRIVER = 'sqlite'; | ||
} |