|
15 | 15 | use Doctrine\DBAL\Driver\Middleware as MiddlewareInterface;
|
16 | 16 | use Doctrine\DBAL\DriverManager;
|
17 | 17 | use Doctrine\DBAL\ParameterType;
|
| 18 | +use Doctrine\DBAL\Query\QueryBuilder; |
18 | 19 | use Doctrine\DBAL\Result;
|
19 | 20 | use Doctrine\DBAL\Schema\DefaultSchemaManagerFactory;
|
20 | 21 | use Doctrine\DBAL\Statement;
|
@@ -208,11 +209,11 @@ public function testTransaction(callable $endTransactionMethod, string $expected
|
208 | 209 | $this->assertCount(9, $debug);
|
209 | 210 | $this->assertSame('"START TRANSACTION"', $debug[1]['sql']);
|
210 | 211 | $this->assertGreaterThan(0, $debug[1]['executionMS']);
|
211 |
| - $this->assertSame('SAVEPOINT DOCTRINE2_SAVEPOINT_2', $debug[2]['sql']); |
| 212 | + $this->assertSame(method_exists(QueryBuilder::class, 'resetOrderBy') ? 'SAVEPOINT DOCTRINE_2' : 'SAVEPOINT DOCTRINE2_SAVEPOINT_2', $debug[2]['sql']); |
212 | 213 | $this->assertGreaterThan(0, $debug[2]['executionMS']);
|
213 | 214 | $this->assertSame('INSERT INTO products(name, price, stock) VALUES ("product1", 12.5, 5)', $debug[3]['sql']);
|
214 | 215 | $this->assertGreaterThan(0, $debug[3]['executionMS']);
|
215 |
| - $this->assertSame(('"ROLLBACK"' === $expectedEndTransactionDebug ? 'ROLLBACK TO' : 'RELEASE').' SAVEPOINT DOCTRINE2_SAVEPOINT_2', $debug[4]['sql']); |
| 216 | + $this->assertSame(('"ROLLBACK"' === $expectedEndTransactionDebug ? 'ROLLBACK TO' : 'RELEASE').' '.(method_exists(QueryBuilder::class, 'resetOrderBy') ? 'SAVEPOINT DOCTRINE_2' : 'SAVEPOINT DOCTRINE2_SAVEPOINT_2'), $debug[4]['sql']); |
216 | 217 | $this->assertGreaterThan(0, $debug[4]['executionMS']);
|
217 | 218 | $this->assertSame($expectedEndTransactionDebug, $debug[5]['sql']);
|
218 | 219 | $this->assertGreaterThan(0, $debug[5]['executionMS']);
|
|
0 commit comments