Skip to content

Commit f06e24d

Browse files
committed
update
1 parent e7b341d commit f06e24d

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

src/swoole/tests/Unit/SymfonyHttpBridgeTest.php

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,11 @@ public function testThatSymfonyResponseIsReflected(): void
7777
['set-cookie', $fooCookie],
7878
['set-cookie', $barCookie],
7979
];
80-
$response->expects(self::exactly(3))->method('header')->willReturnCallback(
81-
fn($key, $value) => $this->assertEquals([$key, $value], array_shift($expectedHeaders))
82-
);
80+
$response->expects(self::exactly(3))->method('header')->willReturnCallback(function ($key, $value) use ($expectedHeaders) {
81+
$this->assertEquals([$key, $value], array_shift($expectedHeaders));
82+
83+
return true;
84+
});
8385
$response->expects(self::once())->method('status')->with(201);
8486
$response->expects(self::once())->method('end')->with('Test');
8587

@@ -100,11 +102,13 @@ public function testThatSymfonyStreamedResponseIsReflected(): void
100102
$expectedWrites = [
101103
"Foo\n",
102104
"Bar\n",
103-
''
105+
'',
104106
];
105-
$response->expects(self::exactly(3))->method('write')->willReturnCallback(
106-
fn($string) => $this->assertSame(array_shift($expectedWrites), $string)
107-
);
107+
$response->expects(self::exactly(3))->method('write')->willReturnCallback(function ($string) use ($expectedWrites) {
108+
$this->assertSame(array_shift($expectedWrites), $string);
109+
110+
return true;
111+
});
108112
$response->expects(self::once())->method('end');
109113

110114
SymfonyHttpBridge::reflectSymfonyResponse($sfResponse, $response);

0 commit comments

Comments
 (0)