1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
<?php
declare(strict_types=1);
namespace Doctrine\DBAL\Tests\Functional\Driver\PDO;
use Doctrine\DBAL\Tests\FunctionalTestCase;
use Doctrine\DBAL\Tests\TestUtil;
use Pdo\Mysql;
use Pdo\Pgsql;
use Pdo\Sqlite;
use PHPUnit\Framework\Attributes\RequiresPhp;
#[RequiresPhp('8.4')]
final class PDOSubclassTest extends FunctionalTestCase
{
public function testMySQLSubclass(): void
{
if (! TestUtil::isDriverOneOf('pdo_mysql')) {
self::markTestSkipped('This test requires the pdo_mysql driver.');
}
self::assertInstanceOf(Mysql::class, $this->connection->getNativeConnection());
}
public function testPgSQLSubclass(): void
{
if (! TestUtil::isDriverOneOf('pdo_pgsql')) {
self::markTestSkipped('This test requires the pdo_pgsql driver.');
}
self::assertInstanceOf(Pgsql::class, $this->connection->getNativeConnection());
}
public function testSQLiteSubclass(): void
{
if (! TestUtil::isDriverOneOf('pdo_sqlite')) {
self::markTestSkipped('This test requires the pdo_sqlite driver.');
}
self::assertInstanceOf(Sqlite::class, $this->connection->getNativeConnection());
}
}
|