-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
10 changed files
with
114 additions
and
20 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\Mssql\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\Mssql\Tests; | ||
|
||
use Yiisoft\Db\Mssql\Column\ColumnBuilder; | ||
use Yiisoft\Db\Mssql\Tests\Support\TestTrait; | ||
use Yiisoft\Db\Tests\AbstractColumnBuilderTest; | ||
|
||
/** | ||
* @group mssql | ||
*/ | ||
class ColumnBuilderTest extends AbstractColumnBuilderTest | ||
{ | ||
use TestTrait; | ||
|
||
public function getColumnBuilderClass(): string | ||
{ | ||
return ColumnBuilder::class; | ||
} | ||
|
||
/** | ||
* @dataProvider \Yiisoft\Db\Mssql\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\Mssql\Tests\Provider; | ||
|
||
use Yiisoft\Db\Constant\ColumnType; | ||
use Yiisoft\Db\Mssql\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