Skip to content

Commit 16e17f6

Browse files
committed
Update FactoryStreamingClientTest to expect AUTH with username and password (3 args)
1 parent e219502 commit 16e17f6

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/Io/FactoryStreamingClientTest.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function testWillWriteSelectCommandIfTargetContainsDbQueryParameter(): vo
110110
public function testWillWriteAuthCommandIfRedisUriContainsUserInfo(): void
111111
{
112112
$stream = $this->createMock(ConnectionInterface::class);
113-
$stream->expects($this->once())->method('write')->with("*2\r\n$4\r\nauth\r\n$5\r\nworld\r\n");
113+
$stream->expects($this->once())->method('write')->with("*3\r\n$4\r\nauth\r\n$5\r\nhello\r\n$5\r\nworld\r\n");
114114

115115
$loop = $this->createMock(LoopInterface::class);
116116
$loop->expects($this->once())->method('addTimer');
@@ -124,7 +124,7 @@ public function testWillWriteAuthCommandIfRedisUriContainsUserInfo(): void
124124
public function testWillWriteAuthCommandIfRedisUriContainsEncodedUserInfo(): void
125125
{
126126
$stream = $this->createMock(ConnectionInterface::class);
127-
$stream->expects($this->once())->method('write')->with("*2\r\n$4\r\nauth\r\n$5\r\nh@llo\r\n");
127+
$stream->expects($this->once())->method('write')->with("*3\r\n$4\r\nauth\r\n$0\r\n\r\n$5\r\nh@llo\r\n");
128128

129129
$loop = $this->createMock(LoopInterface::class);
130130
$loop->expects($this->once())->method('addTimer');
@@ -166,7 +166,7 @@ public function testWillWriteAuthCommandIfTargetContainsEncodedPasswordQueryPara
166166
public function testWillWriteAuthCommandIfRedissUriContainsUserInfo(): void
167167
{
168168
$stream = $this->createMock(ConnectionInterface::class);
169-
$stream->expects($this->once())->method('write')->with("*2\r\n$4\r\nauth\r\n$5\r\nworld\r\n");
169+
$stream->expects($this->once())->method('write')->with("*3\r\n$4\r\nauth\r\n$5\r\nhello\r\n$5\r\nworld\r\n");
170170

171171
$loop = $this->createMock(LoopInterface::class);
172172
$loop->expects($this->once())->method('addTimer');
@@ -203,7 +203,7 @@ public function testWillNotWriteAnyCommandIfRedisUnixUriContainsNoPasswordOrDb()
203203
public function testWillWriteAuthCommandIfRedisUnixUriContainsUserInfo(): void
204204
{
205205
$stream = $this->createMock(ConnectionInterface::class);
206-
$stream->expects($this->once())->method('write')->with("*2\r\n$4\r\nauth\r\n$5\r\nworld\r\n");
206+
$stream->expects($this->once())->method('write')->with("*3\r\n$4\r\nauth\r\n$5\r\nhello\r\n$5\r\nworld\r\n");
207207

208208
$loop = $this->createMock(LoopInterface::class);
209209
$loop->expects($this->once())->method('addTimer');
@@ -218,7 +218,7 @@ public function testWillResolveWhenAuthCommandReceivesOkResponseIfRedisUriContai
218218
{
219219
$dataHandler = null;
220220
$stream = $this->createMock(ConnectionInterface::class);
221-
$stream->expects($this->once())->method('write')->with("*2\r\n$4\r\nauth\r\n$5\r\nworld\r\n");
221+
$stream->expects($this->once())->method('write')->with("*3\r\n$4\r\nauth\r\n$0\r\n\r\n$5\r\nworld\r\n");
222222
$stream->expects($this->exactly(2))->method('on')->withConsecutive(
223223
['data', $this->callback(function ($arg) use (&$dataHandler) {
224224
$dataHandler = $arg;
@@ -240,7 +240,7 @@ public function testWillRejectAndCloseAutomaticallyWhenAuthCommandReceivesErrorR
240240
{
241241
$dataHandler = null;
242242
$stream = $this->createMock(ConnectionInterface::class);
243-
$stream->expects($this->once())->method('write')->with("*2\r\n$4\r\nauth\r\n$5\r\nworld\r\n");
243+
$stream->expects($this->once())->method('write')->with("*3\r\n$4\r\nauth\r\n$0\r\n\r\n$5\r\nworld\r\n");
244244
$stream->expects($this->once())->method('close');
245245
$stream->expects($this->exactly(2))->method('on')->withConsecutive(
246246
['data', $this->callback(function ($arg) use (&$dataHandler) {
@@ -277,7 +277,7 @@ public function testWillRejectAndCloseAutomaticallyWhenConnectionIsClosedWhileWa
277277
{
278278
$closeHandler = null;
279279
$stream = $this->createMock(ConnectionInterface::class);
280-
$stream->expects($this->once())->method('write')->with("*2\r\n$4\r\nauth\r\n$5\r\nworld\r\n");
280+
$stream->expects($this->once())->method('write')->with("*3\r\n$4\r\nauth\r\n$0\r\n\r\n$5\r\nworld\r\n");
281281
$stream->expects($this->once())->method('close');
282282
$stream->expects($this->exactly(2))->method('on')->withConsecutive(
283283
['data', $this->anything()],

0 commit comments

Comments
 (0)