Skip to content

Commit

Permalink
Remove src\TestSupport\TestColumnSchemaBuilderTrait from yiisoft\db. (#…
Browse files Browse the repository at this point in the history
…119)

* Remove src\TestSupport\TestColumnSchemaBuilderTrait from yiisoft\db.
  • Loading branch information
terabytesoftw committed Dec 7, 2022
1 parent dfead62 commit 559ca9d
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 21 deletions.
29 changes: 8 additions & 21 deletions tests/ColumnSchemaBuilderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,22 @@

namespace Yiisoft\Db\Oracle\Tests;

use Yiisoft\Db\TestSupport\TestColumnSchemaBuilderTrait;
use Yiisoft\Db\Oracle\Schema;
use Yiisoft\Db\Oracle\Tests\Support\TestTrait;
use Yiisoft\Db\Tests\Common\CommonColumnSchemaBuilderTest;

/**
* @group oracle
*
* @psalm-suppress PropertyNotSetInConstructor
*/
final class ColumnSchemaBuilderTest extends TestCase
final class ColumnSchemaBuilderTest extends CommonColumnSchemaBuilderTest
{
use TestColumnSchemaBuilderTrait;
use TestTrait;

/**
* @return array
* @dataProvider \Yiisoft\Db\Oracle\Tests\Provider\ColumnSchemaBuilderProvider::types();
*/
public function typesProvider()
{
return [
['integer UNSIGNED', Schema::TYPE_INTEGER, null, [
['unsigned'],
]],
['integer(10) UNSIGNED', Schema::TYPE_INTEGER, 10, [
['unsigned'],
]],
];
}

/**
* @dataProvider typesProviderTrait
*/
public function testCustomTypes(string $expected, string $type, ?int $length, mixed $calls): void
public function testCustomTypes(string $expected, string $type, int|null $length, array $calls): void
{
$this->checkBuildString($expected, $type, $length, $calls);
}
Expand Down
26 changes: 26 additions & 0 deletions tests/Provider/ColumnSchemaBuilderProvider.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?php

declare(strict_types=1);

namespace Yiisoft\Db\Oracle\Tests\Provider;

use Yiisoft\Db\Schema\Schema;
use Yiisoft\Db\Tests\Provider\AbstractColumnSchemaBuilderProvider;

final class ColumnSchemaBuilderProvider extends AbstractColumnSchemaBuilderProvider
{
public function types(): array
{
$types = parent::types();

$types[0][0] = 'integer UNSIGNED DEFAULT NULL NULL';
$types[1][0] = 'integer(10) UNSIGNED';

return array_merge(
$types,
[
['integer UNSIGNED', Schema::TYPE_INTEGER, null, [['unsigned']]],
],
);
}
}

0 comments on commit 559ca9d

Please sign in to comment.