|
| 1 | +<?php |
| 2 | + |
| 3 | +declare(strict_types=1); |
| 4 | + |
| 5 | +namespace Doctrine\DBAL\Tests\Functional\Driver\PDO; |
| 6 | + |
| 7 | +use Doctrine\DBAL\Tests\FunctionalTestCase; |
| 8 | +use Doctrine\DBAL\Tests\TestUtil; |
| 9 | +use Pdo\Mysql; |
| 10 | +use Pdo\Oci; |
| 11 | +use Pdo\Pgsql; |
| 12 | +use Pdo\Sqlite; |
| 13 | +use Pdo\Sqlsrv; |
| 14 | +use PHPUnit\Framework\Attributes\RequiresPhp; |
| 15 | + |
| 16 | +#[RequiresPhp('8.4')] |
| 17 | +final class PDOSubclassTest extends FunctionalTestCase |
| 18 | +{ |
| 19 | + public function testMySQLSubclass(): void |
| 20 | + { |
| 21 | + if (! TestUtil::isDriverOneOf('pdo_mysql')) { |
| 22 | + self::markTestSkipped('This test requires the pdo_mysql driver.'); |
| 23 | + } |
| 24 | + |
| 25 | + self::assertInstanceOf(Mysql::class, $this->connection->getNativeConnection()); |
| 26 | + } |
| 27 | + |
| 28 | + public function testOCISubclass(): void |
| 29 | + { |
| 30 | + if (! TestUtil::isDriverOneOf('pdo_oci')) { |
| 31 | + self::markTestSkipped('This test requires the pdo_oci driver.'); |
| 32 | + } |
| 33 | + |
| 34 | + self::assertInstanceOf(Oci::class, $this->connection->getNativeConnection()); |
| 35 | + } |
| 36 | + |
| 37 | + public function testPgSQLSubclass(): void |
| 38 | + { |
| 39 | + if (! TestUtil::isDriverOneOf('pdo_pgsql')) { |
| 40 | + self::markTestSkipped('This test requires the pdo_pgsql driver.'); |
| 41 | + } |
| 42 | + |
| 43 | + self::assertInstanceOf(Pgsql::class, $this->connection->getNativeConnection()); |
| 44 | + } |
| 45 | + |
| 46 | + public function testSQLiteSubclass(): void |
| 47 | + { |
| 48 | + if (! TestUtil::isDriverOneOf('pdo_sqlite')) { |
| 49 | + self::markTestSkipped('This test requires the pdo_sqlite driver.'); |
| 50 | + } |
| 51 | + |
| 52 | + self::assertInstanceOf(Sqlite::class, $this->connection->getNativeConnection()); |
| 53 | + } |
| 54 | + |
| 55 | + public function testSQLSrvSubclass(): void |
| 56 | + { |
| 57 | + if (! TestUtil::isDriverOneOf('pdo_sqlsrv')) { |
| 58 | + self::markTestSkipped('This test requires the pdo_sqlsrv driver.'); |
| 59 | + } |
| 60 | + |
| 61 | + self::assertInstanceOf(Sqlsrv::class, $this->connection->getNativeConnection()); |
| 62 | + } |
| 63 | +} |
0 commit comments