diff --git a/tests/Doctrine/Tests/ORM/Functional/QueryDqlFunctionTest.php b/tests/Doctrine/Tests/ORM/Functional/QueryDqlFunctionTest.php index b4e08ba47cf..c3a88353fbd 100644 --- a/tests/Doctrine/Tests/ORM/Functional/QueryDqlFunctionTest.php +++ b/tests/Doctrine/Tests/ORM/Functional/QueryDqlFunctionTest.php @@ -5,7 +5,7 @@ namespace Doctrine\Tests\ORM\Functional; use DateTimeImmutable; -use Doctrine\DBAL\Platforms\SqlitePlatform; +use Doctrine\DBAL\Platforms\SQLitePlatform; use Doctrine\ORM\AbstractQuery; use Doctrine\Tests\Models\Company\CompanyManager; use Doctrine\Tests\OrmFunctionalTestCase; @@ -317,7 +317,7 @@ public function testDateAdd(string $unit, int $amount, int $delta = 0): void if ( $unit === 'month' && $inOneUnit->format('m') === $now->modify('+2 month')->format('m') - && ! $this->_em->getConnection()->getDatabasePlatform() instanceof SqlitePlatform + && ! $this->_em->getConnection()->getDatabasePlatform() instanceof SQLitePlatform ) { $inOneUnit = new DateTimeImmutable('last day of next month'); } @@ -355,7 +355,7 @@ public function testDateSub(string $unit, int $amount, int $delta = 0): void if ( $unit === 'month' && $oneUnitAgo->format('m') === $now->format('m') - && ! $this->_em->getConnection()->getDatabasePlatform() instanceof SqlitePlatform + && ! $this->_em->getConnection()->getDatabasePlatform() instanceof SQLitePlatform ) { $oneUnitAgo = new DateTimeImmutable('last day of previous month'); } diff --git a/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DDC214Test.php b/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DDC214Test.php index 18e86bd896e..494a186ed71 100644 --- a/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DDC214Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/SchemaTool/DDC214Test.php @@ -4,7 +4,7 @@ namespace Doctrine\Tests\ORM\Functional\SchemaTool; -use Doctrine\DBAL\Platforms\SqlitePlatform; +use Doctrine\DBAL\Platforms\SQLitePlatform; use Doctrine\Tests\Models; use Doctrine\Tests\OrmFunctionalTestCase; @@ -25,7 +25,7 @@ protected function setUp(): void $conn = $this->_em->getConnection(); - if ($conn->getDatabasePlatform() instanceof SqlitePlatform) { + if ($conn->getDatabasePlatform() instanceof SQLitePlatform) { self::markTestSkipped('SQLite does not support ALTER TABLE statements.'); } } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1695Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1695Test.php index c7435c78b55..7abeeefa233 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1695Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1695Test.php @@ -5,7 +5,7 @@ namespace Doctrine\Tests\ORM\Functional\Ticket; use DateTimeZone; -use Doctrine\DBAL\Platforms\SqlitePlatform; +use Doctrine\DBAL\Platforms\SQLitePlatform; use Doctrine\ORM\Mapping\Column; use Doctrine\ORM\Mapping\Entity; use Doctrine\ORM\Mapping\GeneratedValue; @@ -20,7 +20,7 @@ class DDC1695Test extends OrmFunctionalTestCase { public function testIssue(): void { - if (! $this->_em->getConnection()->getDatabasePlatform() instanceof SqlitePlatform) { + if (! $this->_em->getConnection()->getDatabasePlatform() instanceof SQLitePlatform) { self::markTestSkipped('Only with sqlite'); } diff --git a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC933Test.php b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC933Test.php index 3219f4247fc..2c198785914 100644 --- a/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC933Test.php +++ b/tests/Doctrine/Tests/ORM/Functional/Ticket/DDC933Test.php @@ -5,7 +5,7 @@ namespace Doctrine\Tests\ORM\Functional\Ticket; use Doctrine\DBAL\LockMode; -use Doctrine\DBAL\Platforms\SqlitePlatform; +use Doctrine\DBAL\Platforms\SQLitePlatform; use Doctrine\ORM\Exception\ORMException; use Doctrine\ORM\OptimisticLockException; use Doctrine\ORM\TransactionRequiredException; @@ -30,7 +30,7 @@ protected function setUp(): void */ public function testLockCTIClass(): void { - if ($this->_em->getConnection()->getDatabasePlatform() instanceof SqlitePlatform) { + if ($this->_em->getConnection()->getDatabasePlatform() instanceof SQLitePlatform) { self::markTestSkipped('It should not run on in-memory databases'); } diff --git a/tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php b/tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php index ba04c8753b7..9e660fffb6a 100644 --- a/tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php +++ b/tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php @@ -8,7 +8,7 @@ use Doctrine\DBAL\Platforms\MySQLPlatform; use Doctrine\DBAL\Platforms\OraclePlatform; use Doctrine\DBAL\Platforms\PostgreSQLPlatform; -use Doctrine\DBAL\Platforms\SqlitePlatform; +use Doctrine\DBAL\Platforms\SQLitePlatform; use Doctrine\DBAL\Types\Type as DBALType; use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\Mapping\Column; @@ -30,8 +30,12 @@ use Doctrine\Tests\OrmTestCase; use Exception; +use function class_exists; use function sprintf; +// DBAL 3 compatibility +class_exists('Doctrine\\DBAL\\Platforms\\SqlitePlatform'); + class SelectSqlGenerationTest extends OrmTestCase { private EntityManagerInterface $entityManager; @@ -929,7 +933,7 @@ public function testOrderBySupportsSingleValuedPathExpressionInverseSide(): void public function testBooleanLiteralInWhereOnSqlite(): void { - $this->entityManager = $this->createTestEntityManagerWithPlatform(new SqlitePlatform()); + $this->entityManager = $this->createTestEntityManagerWithPlatform(new SQLitePlatform()); $this->assertSqlGeneration( 'SELECT b FROM Doctrine\Tests\Models\Generic\BooleanModel b WHERE b.booleanField = true', 'SELECT b0_.id AS id_0, b0_.booleanField AS booleanField_1 FROM boolean_model b0_ WHERE b0_.booleanField = 1' @@ -1064,7 +1068,7 @@ public function testSubselectInSelect(): void */ public function testPessimisticWriteLockQueryHint(): void { - if ($this->entityManager->getConnection()->getDatabasePlatform() instanceof SqlitePlatform) { + if ($this->entityManager->getConnection()->getDatabasePlatform() instanceof SQLitePlatform) { self::markTestSkipped('SqLite does not support Row locking at all.'); } diff --git a/tests/Doctrine/Tests/ORM/Tools/Console/Command/SchemaTool/AbstractCommandTest.php b/tests/Doctrine/Tests/ORM/Tools/Console/Command/SchemaTool/AbstractCommandTest.php index 558ff6b927d..79b0cff23c8 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Console/Command/SchemaTool/AbstractCommandTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/Console/Command/SchemaTool/AbstractCommandTest.php @@ -4,7 +4,7 @@ namespace Doctrine\Tests\ORM\Tools\Console\Command\SchemaTool; -use Doctrine\DBAL\Platforms\SqlitePlatform; +use Doctrine\DBAL\Platforms\SQLitePlatform; use Doctrine\ORM\ORMSetup; use Doctrine\ORM\Tools\Console\Command\SchemaTool\AbstractCommand; use Doctrine\ORM\Tools\Console\EntityManagerProvider\SingleManagerProvider; @@ -22,7 +22,7 @@ protected function getCommandTester(string $commandClass): CommandTester __DIR__ . '/Models', ])); - if (! $entityManager->getConnection()->getDatabasePlatform() instanceof SqlitePlatform) { + if (! $entityManager->getConnection()->getDatabasePlatform() instanceof SQLitePlatform) { self::markTestSkipped('We are testing the symfony/console integration'); } diff --git a/tests/Doctrine/Tests/ORM/Tools/Console/Command/ValidateSchemaCommandTest.php b/tests/Doctrine/Tests/ORM/Tools/Console/Command/ValidateSchemaCommandTest.php index 99eb6a80f81..7e52ac1cd62 100644 --- a/tests/Doctrine/Tests/ORM/Tools/Console/Command/ValidateSchemaCommandTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/Console/Command/ValidateSchemaCommandTest.php @@ -4,7 +4,7 @@ namespace Doctrine\Tests\ORM\Tools\Console\Command; -use Doctrine\DBAL\Platforms\SqlitePlatform; +use Doctrine\DBAL\Platforms\SQLitePlatform; use Doctrine\ORM\Tools\Console\Command\ValidateSchemaCommand; use Doctrine\ORM\Tools\Console\EntityManagerProvider\SingleManagerProvider; use Doctrine\Tests\OrmFunctionalTestCase; @@ -27,7 +27,7 @@ protected function setUp(): void { parent::setUp(); - if (! $this->_em->getConnection()->getDatabasePlatform() instanceof SqlitePlatform) { + if (! $this->_em->getConnection()->getDatabasePlatform() instanceof SQLitePlatform) { self::markTestSkipped('Only with sqlite'); } diff --git a/tests/Doctrine/Tests/TestUtil.php b/tests/Doctrine/Tests/TestUtil.php index 5a7f0ab0028..225152cf2d1 100644 --- a/tests/Doctrine/Tests/TestUtil.php +++ b/tests/Doctrine/Tests/TestUtil.php @@ -9,7 +9,7 @@ use Doctrine\DBAL\Connection; use Doctrine\DBAL\DriverManager; use Doctrine\DBAL\Exception\DatabaseObjectNotFoundException; -use Doctrine\DBAL\Platforms\SqlitePlatform; +use Doctrine\DBAL\Platforms\SQLitePlatform; use UnexpectedValueException; use function assert; @@ -89,7 +89,7 @@ private static function initializeDatabase(): void $platform = $privConn->getDatabasePlatform(); - if ($platform instanceof SqlitePlatform) { + if ($platform instanceof SQLitePlatform) { $schema = $testConn->createSchemaManager()->createSchema(); $stmts = $schema->toDropSql($testConn->getDatabasePlatform());