Skip to content

Commit

Permalink
tests: add tests for boolean column
Browse files Browse the repository at this point in the history
  • Loading branch information
MartkCz committed Oct 21, 2024
1 parent 32c29c7 commit 4d14ff3
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 0 deletions.
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());
}
}
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';
}
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';
}
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';
}
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';
}

0 comments on commit 4d14ff3

Please sign in to comment.