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

Adjust casing of SQLitePlatform for DBAL 4 #9924

Merged
merged 1 commit into from
Jul 20, 2022
Merged
Show file tree
Hide file tree
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: 3 additions & 3 deletions tests/Doctrine/Tests/ORM/Functional/QueryDqlFunctionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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');
}
Expand Down Expand Up @@ -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');
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Doctrine/Tests/ORM/Functional/SchemaTool/DDC214Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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.');
}
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Doctrine/Tests/ORM/Functional/Ticket/DDC1695Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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');
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Doctrine/Tests/ORM/Functional/Ticket/DDC933Test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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');
}

Expand Down
10 changes: 7 additions & 3 deletions tests/Doctrine/Tests/ORM/Query/SelectSqlGenerationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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'
Expand Down Expand Up @@ -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.');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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');
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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');
}

Expand Down
4 changes: 2 additions & 2 deletions tests/Doctrine/Tests/TestUtil.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());

Expand Down