|
8 | 8 | use Doctrine\DBAL\Driver; |
9 | 9 | use Doctrine\DBAL\Driver\Result; |
10 | 10 | use Doctrine\DBAL\Platforms\AbstractPlatform; |
11 | | -use Doctrine\DBAL\Schema\AbstractSchemaManager; |
12 | | -use Doctrine\DBAL\Schema\Name\UnquotedIdentifierFolding; |
13 | | -use Doctrine\DBAL\Schema\SchemaConfig; |
| 11 | +use Doctrine\DBAL\Platforms\SQLitePlatform; |
14 | 12 | use Doctrine\ORM\Cache\CacheConfiguration; |
15 | 13 | use Doctrine\ORM\Cache\CacheFactory; |
16 | 14 | use Doctrine\ORM\Cache\DefaultCacheFactory; |
|
22 | 20 | use Psr\Cache\CacheItemPoolInterface; |
23 | 21 | use Symfony\Component\Cache\Adapter\ArrayAdapter; |
24 | 22 |
|
25 | | -use function enum_exists; |
| 23 | +use function class_exists; |
26 | 24 | use function method_exists; |
27 | 25 | use function realpath; |
28 | 26 | use function sprintf; |
29 | 27 |
|
| 28 | +// DBAL 3 compatibility |
| 29 | +class_exists('Doctrine\\DBAL\\Platforms\\SqlitePlatform'); |
| 30 | + |
30 | 31 | /** |
31 | 32 | * Base testcase class for all ORM testcases. |
32 | 33 | */ |
@@ -71,9 +72,7 @@ protected function createAttributeDriver(array $paths = []): AttributeDriver |
71 | 72 | */ |
72 | 73 | protected function getTestEntityManager(): EntityManagerMock |
73 | 74 | { |
74 | | - return $this->buildTestEntityManagerWithPlatform( |
75 | | - $this->createConnectionMock($this->createPlatformMock()), |
76 | | - ); |
| 75 | + return $this->createTestEntityManagerWithPlatform(new SQLitePlatform()); |
77 | 76 | } |
78 | 77 |
|
79 | 78 | protected function createTestEntityManagerWithConnection(Connection $connection): EntityManagerMock |
@@ -153,24 +152,6 @@ private function createConnectionMock(AbstractPlatform $platform): Connection |
153 | 152 | return $connection; |
154 | 153 | } |
155 | 154 |
|
156 | | - private function createPlatformMock(): AbstractPlatform |
157 | | - { |
158 | | - $schemaManager = $this->createMock(AbstractSchemaManager::class); |
159 | | - $schemaManager->method('createSchemaConfig') |
160 | | - ->willReturn(new SchemaConfig()); |
161 | | - |
162 | | - $platform = $this->getMockBuilder(AbstractPlatform::class) |
163 | | - ->setConstructorArgs(enum_exists(UnquotedIdentifierFolding::class) ? [UnquotedIdentifierFolding::UPPER] : []) |
164 | | - ->onlyMethods(['supportsIdentityColumns', 'createSchemaManager']) |
165 | | - ->getMockForAbstractClass(); |
166 | | - $platform->method('supportsIdentityColumns') |
167 | | - ->willReturn(true); |
168 | | - $platform->method('createSchemaManager') |
169 | | - ->willReturn($schemaManager); |
170 | | - |
171 | | - return $platform; |
172 | | - } |
173 | | - |
174 | 155 | private function createDriverMock(AbstractPlatform $platform): Driver |
175 | 156 | { |
176 | 157 | $result = $this->createMock(Result::class); |
|
0 commit comments