Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit df36e0b

Browse files
committed
[Messenger] Fix broken Redis mocks
1 parent c80fe58 commit df36e0b

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
runs-on: Ubuntu-20.04
1616

1717
env:
18-
extensions: amqp,apcu,igbinary,intl,mbstring,memcached,mongodb,redis
18+
extensions: amqp,apcu,igbinary,intl,mbstring,memcached,mongodb,redis-5.3.4
1919

2020
strategy:
2121
matrix:

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function testFromDsnWithTls()
7878
$redis->expects($this->once())
7979
->method('connect')
8080
->with('tls://127.0.0.1', 6379)
81-
->willReturn(null);
81+
->willReturn(true);
8282

8383
Connection::fromDsn('redis://127.0.0.1?tls=1', [], $redis);
8484
}
@@ -92,7 +92,7 @@ public function testFromDsnWithTlsOption()
9292
$redis->expects($this->once())
9393
->method('connect')
9494
->with('tls://127.0.0.1', 6379)
95-
->willReturn(null);
95+
->willReturn(true);
9696

9797
Connection::fromDsn('redis://127.0.0.1', ['tls' => true], $redis);
9898
}
@@ -103,7 +103,7 @@ public function testFromDsnWithRedissScheme()
103103
$redis->expects($this->once())
104104
->method('connect')
105105
->with('tls://127.0.0.1', 6379)
106-
->willReturn(null);
106+
->willReturn(true);
107107

108108
Connection::fromDsn('rediss://127.0.0.1', [], $redis);
109109
}
@@ -315,7 +315,7 @@ public function testMaxEntries()
315315

316316
$redis->expects($this->exactly(1))->method('xadd')
317317
->with('queue', '*', ['message' => '{"body":"1","headers":[]}'], 20000, true)
318-
->willReturn(1);
318+
->willReturn('1');
319319

320320
$connection = Connection::fromDsn('redis://localhost/queue?stream_max_entries=20000', [], $redis); // 1 = always
321321
$connection->add('1', []);
@@ -355,7 +355,7 @@ public function testLastErrorGetsCleared()
355355
{
356356
$redis = $this->createMock(\Redis::class);
357357

358-
$redis->expects($this->once())->method('xadd')->willReturn(0);
358+
$redis->expects($this->once())->method('xadd')->willReturn('0');
359359
$redis->expects($this->once())->method('xack')->willReturn(0);
360360

361361
$redis->method('getLastError')->willReturnOnConsecutiveCalls('xadd error', 'xack error');

0 commit comments

Comments
 (0)