-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
117 additions
and
21 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
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 Yiisoft\Db\Oracle\Column; | ||
|
||
use Yiisoft\Db\Constant\ColumnType; | ||
use Yiisoft\Db\Schema\Column\ColumnSchemaInterface; | ||
|
||
final class ColumnBuilder extends \Yiisoft\Db\Schema\Column\ColumnBuilder | ||
{ | ||
public static function binary(int|null $size = null): ColumnSchemaInterface | ||
{ | ||
return (new BinaryColumnSchema(ColumnType::BINARY)) | ||
->size($size); | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Yiisoft\Db\Oracle\Tests; | ||
|
||
use Yiisoft\Db\Oracle\Column\ColumnBuilder; | ||
use Yiisoft\Db\Oracle\Tests\Support\TestTrait; | ||
use Yiisoft\Db\Tests\AbstractColumnBuilderTest; | ||
|
||
/** | ||
* @group oracle | ||
*/ | ||
class ColumnBuilderTest extends AbstractColumnBuilderTest | ||
{ | ||
use TestTrait; | ||
|
||
public function getColumnBuilderClass(): string | ||
{ | ||
return ColumnBuilder::class; | ||
} | ||
|
||
/** | ||
* @dataProvider \Yiisoft\Db\Oracle\Tests\Provider\ColumnBuilderProvider::buildingMethods | ||
*/ | ||
public function testBuildingMethods( | ||
string $buildingMethod, | ||
array $args, | ||
string $expectedInstanceOf, | ||
string $expectedType, | ||
array $expectedMethodResults = [], | ||
): void { | ||
parent::testBuildingMethods($buildingMethod, $args, $expectedInstanceOf, $expectedType, $expectedMethodResults); | ||
} | ||
} |
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
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,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Yiisoft\Db\Oracle\Tests\Provider; | ||
|
||
use Yiisoft\Db\Constant\ColumnType; | ||
use Yiisoft\Db\Oracle\Column\BinaryColumnSchema; | ||
|
||
class ColumnBuilderProvider extends \Yiisoft\Db\Tests\Provider\ColumnBuilderProvider | ||
{ | ||
public static function buildingMethods(): array | ||
{ | ||
return [ | ||
// building method, args, expected instance of, expected type, expected column method results | ||
...parent::buildingMethods(), | ||
['binary', [], BinaryColumnSchema::class, ColumnType::BINARY], | ||
['binary', [8], BinaryColumnSchema::class, ColumnType::BINARY, ['getSize' => 8]], | ||
]; | ||
} | ||
} |
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