Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement the ability for user-defined type casting #385

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions tests/ColumnFactoryTest.php
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
use PHPUnit\Framework\Attributes\DataProviderExternal;
use Yiisoft\Db\Constant\ColumnType;
use Yiisoft\Db\Expression\Expression;
use Yiisoft\Db\Mysql\Column\ColumnFactory;
use Yiisoft\Db\Mysql\Tests\Provider\ColumnFactoryProvider;
use Yiisoft\Db\Mysql\Tests\Support\TestTrait;
use Yiisoft\Db\Schema\Column\ColumnInterface;
@@ -19,6 +20,11 @@ final class ColumnFactoryTest extends AbstractColumnFactoryTest
{
use TestTrait;

protected function getColumnFactoryClass(): string
{
return ColumnFactory::class;
}

#[DataProviderExternal(ColumnFactoryProvider::class, 'dbTypes')]
public function testFromDbType(string $dbType, string $expectedType, string $expectedInstanceOf): void
{
2 changes: 1 addition & 1 deletion tests/Support/TestTrait.php
Original file line number Diff line number Diff line change
@@ -71,7 +71,7 @@ public static function setUpBeforeClass(): void
$db->close();
}

private function getDriver(): PdoDriverInterface
protected function getDriver(): PdoDriverInterface
{
return new Driver($this->getDsn(), self::getUsername(), self::getPassword());
}