Skip to content

Commit e0aa32d

Browse files
committed
minor symfony#54527 [Messenger] fix tests (xabbuh)
This PR was merged into the 6.4 branch. Discussion ---------- [Messenger] fix tests | Q | A | ------------- | --- | Branch? | 6.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT Commits ------- 452fac4 fix tests
2 parents 00ba3ad + 452fac4 commit e0aa32d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Symfony/Component/Messenger/Bridge/Doctrine/Tests/Transport/ConnectionTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ private function getDBALConnectionMock()
300300
$platform = $this->createMock(AbstractPlatform::class);
301301

302302
if (!method_exists(QueryBuilder::class, 'forUpdate')) {
303-
$platform->method('getWriteLockSQL')->willReturn('FOR UPDATE');
303+
$platform->method('getWriteLockSQL')->willReturn('FOR UPDATE SKIP LOCKED');
304304
}
305305

306306
$configuration = $this->createMock(\Doctrine\DBAL\Configuration::class);
@@ -584,7 +584,7 @@ class_exists(MySQLPlatform::class) ? new MySQLPlatform() : new MySQL57Platform()
584584

585585
yield 'SQL Server' => [
586586
class_exists(SQLServerPlatform::class) && !class_exists(SQLServer2012Platform::class) ? new SQLServerPlatform() : new SQLServer2012Platform(),
587-
'SELECT m.* FROM messenger_messages m WITH (UPDLOCK, ROWLOCK, READPAST) WHERE (m.queue_name = ?) AND (m.delivered_at is null OR m.delivered_at < ?) AND (m.available_at <= ?) ORDER BY available_at ASC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY ',
587+
sprintf('SELECT m.* FROM messenger_messages m WITH (UPDLOCK, ROWLOCK%s) WHERE (m.queue_name = ?) AND (m.delivered_at is null OR m.delivered_at < ?) AND (m.available_at <= ?) ORDER BY available_at ASC OFFSET 0 ROWS FETCH NEXT 1 ROWS ONLY ', method_exists(QueryBuilder::class, 'forUpdate') ? ', READPAST' : ''),
588588
];
589589

590590
if (!class_exists(MySQL57Platform::class)) {
@@ -597,7 +597,7 @@ class_exists(SQLServerPlatform::class) && !class_exists(SQLServer2012Platform::c
597597
// DBAL < 4
598598
yield 'Oracle' => [
599599
new OraclePlatform(),
600-
'SELECT w.id AS "id", w.body AS "body", w.headers AS "headers", w.queue_name AS "queue_name", w.created_at AS "created_at", w.available_at AS "available_at", w.delivered_at AS "delivered_at" FROM messenger_messages w WHERE w.id IN (SELECT a.id FROM (SELECT m.id FROM messenger_messages m WHERE (m.queue_name = ?) AND (m.delivered_at is null OR m.delivered_at < ?) AND (m.available_at <= ?) ORDER BY available_at ASC) a WHERE ROWNUM <= 1) FOR UPDATE SKIP LOCKED',
600+
sprintf('SELECT w.id AS "id", w.body AS "body", w.headers AS "headers", w.queue_name AS "queue_name", w.created_at AS "created_at", w.available_at AS "available_at", w.delivered_at AS "delivered_at" FROM messenger_messages w WHERE w.id IN (SELECT a.id FROM (SELECT m.id FROM messenger_messages m WHERE (m.queue_name = ?) AND (m.delivered_at is null OR m.delivered_at < ?) AND (m.available_at <= ?) ORDER BY available_at ASC) a WHERE ROWNUM <= 1) FOR UPDATE%s', method_exists(QueryBuilder::class, 'forUpdate') ? ' SKIP LOCKED' : ''),
601601
];
602602
}
603603
}

0 commit comments

Comments
 (0)