-
-
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.
…attributes
- Loading branch information
Showing
7 changed files
with
87 additions
and
1 deletion.
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
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
22 changes: 22 additions & 0 deletions
22
tests/Database/Functional/Driver/Common/Schema/NumberColumnTest.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,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Cycle\Database\Tests\Functional\Driver\Common\Schema; | ||
|
||
use Cycle\Database\Tests\Functional\Driver\Common\BaseTest; | ||
|
||
abstract class NumberColumnTest extends BaseTest | ||
{ | ||
public function testSetPrecisionAndScaleViaAttribute(): void | ||
{ | ||
$schema = $this->schema('table'); | ||
|
||
$column = $schema->column('column')->__call('decimal', ['precision' => 8, 'scale' => 2]); | ||
$schema->save(); | ||
$this->assertSameAsInDB($schema); | ||
|
||
$this->assertSame(8, $column->getPrecision()); | ||
$this->assertSame(2, $column->getScale()); | ||
} | ||
} |
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
17 changes: 17 additions & 0 deletions
17
tests/Database/Functional/Driver/Postgres/Schema/NumberColumnTest.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\NumberColumnTest as CommonClass; | ||
|
||
/** | ||
* @group driver | ||
* @group driver-postgres | ||
*/ | ||
final class NumberColumnTest extends CommonClass | ||
{ | ||
public const DRIVER = 'postgres'; | ||
} |
17 changes: 17 additions & 0 deletions
17
tests/Database/Functional/Driver/SQLServer/Schema/NumberColumnTest.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\NumberColumnTest as CommonClass; | ||
|
||
/** | ||
* @group driver | ||
* @group driver-sqlserver | ||
*/ | ||
final class NumberColumnTest extends CommonClass | ||
{ | ||
public const DRIVER = 'sqlserver'; | ||
} |
17 changes: 17 additions & 0 deletions
17
tests/Database/Functional/Driver/SQLite/Schema/NumberColumnTest.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\NumberColumnTest as CommonClass; | ||
|
||
/** | ||
* @group driver | ||
* @group driver-sqlite | ||
*/ | ||
final class NumberColumnTest extends CommonClass | ||
{ | ||
public const DRIVER = 'sqlite'; | ||
} |