Skip to content

Commit f792eeb

Browse files
committed
try with separate mocks
1 parent 4ae366a commit f792eeb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,10 +373,12 @@ public function testAddReturnId(string $expected, \Redis $redis, int $delay = 0)
373373
public function provideIdPatterns(): \Generator
374374
{
375375
$redis = $this->createMock(\Redis::class);
376-
$redis->method('xadd')->willReturn('THE_MESSAGE_ID');
377-
$redis->method('rawCommand')->willReturn(1);
376+
$redis->expects($this->atLeastOnce())->method('xadd')->willReturn('THE_MESSAGE_ID');
378377

379378
yield 'No delay' => ['/^THE_MESSAGE_ID$/', $redis];
379+
380+
$redis = $this->createMock(\Redis::class);
381+
$redis->expects($this->atLeastOnce())->method('rawCommand')->willReturn('1');
380382
yield '100ms delay' => ['/^\w+\.\d+$/', $redis, 100];
381383
}
382384
}

0 commit comments

Comments
 (0)