|
13 | 13 |
|
14 | 14 | use Doctrine\DBAL\DBALException; |
15 | 15 | use Doctrine\DBAL\Driver\ResultStatement; |
16 | | -use Doctrine\DBAL\ForwardCompatibility\Driver\ResultStatement as ForwardCompatibleResultStatement; |
17 | 16 | use Doctrine\DBAL\Platforms\AbstractPlatform; |
18 | 17 | use Doctrine\DBAL\Query\QueryBuilder; |
19 | 18 | use Doctrine\DBAL\Schema\AbstractSchemaManager; |
20 | 19 | use Doctrine\DBAL\Schema\SchemaConfig; |
21 | 20 | use Doctrine\DBAL\Schema\Synchronizer\SchemaSynchronizer; |
| 21 | +use Doctrine\DBAL\Statement; |
22 | 22 | use PHPUnit\Framework\TestCase; |
23 | 23 | use Symfony\Component\Messenger\Tests\Fixtures\DummyMessage; |
24 | 24 | use Symfony\Component\Messenger\Transport\Doctrine\Connection; |
@@ -145,14 +145,10 @@ private function getQueryBuilderMock() |
145 | 145 |
|
146 | 146 | private function getStatementMock($expectedResult): ResultStatement |
147 | 147 | { |
148 | | - $mockedInterface = interface_exists(ForwardCompatibleResultStatement::class) |
149 | | - ? ForwardCompatibleResultStatement::class |
150 | | - : ResultStatement::class; |
151 | | - |
152 | | - $stmt = $this->createMock($mockedInterface); |
| 148 | + $stmt = $this->createMock(Statement::class); |
153 | 149 |
|
154 | 150 | $stmt->expects($this->once()) |
155 | | - ->method(method_exists($mockedInterface, 'fetchAssociative') ? 'fetchAssociative' : 'fetch') |
| 151 | + ->method(method_exists(Statement::class, 'fetchAssociative') ? 'fetchAssociative' : 'fetch') |
156 | 152 | ->willReturn($expectedResult); |
157 | 153 |
|
158 | 154 | return $stmt; |
@@ -312,12 +308,9 @@ public function testFindAll() |
312 | 308 | 'headers' => json_encode(['type' => DummyMessage::class]), |
313 | 309 | ]; |
314 | 310 |
|
315 | | - $mockedInterface = interface_exists(ForwardCompatibleResultStatement::class) |
316 | | - ? ForwardCompatibleResultStatement::class |
317 | | - : ResultStatement::class; |
318 | | - $stmt = $this->createMock($mockedInterface); |
| 311 | + $stmt = $this->createMock(Statement::class); |
319 | 312 | $stmt->expects($this->once()) |
320 | | - ->method(method_exists($mockedInterface, 'fetchAllAssociative') ? 'fetchAllAssociative' : 'fetchAll') |
| 313 | + ->method(method_exists(Statement::class, 'fetchAllAssociative') ? 'fetchAllAssociative' : 'fetchAll') |
321 | 314 | ->willReturn([$message1, $message2]); |
322 | 315 |
|
323 | 316 | $driverConnection |
|
0 commit comments