Skip to content

Commit 8a8dbf8

Browse files
Support custom HTTP status code. (#2973)
* Support for custom HTTP status code * Update test * Update CHANGELOG-2.0.md Co-authored-by: 李铭昕 <715557344@qq.com>
1 parent 1321adb commit 8a8dbf8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/SwooleStreamTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function testSwooleFileStream()
3030
$swooleResponse = Mockery::mock(SwooleResponse::class);
3131
$file = __FILE__;
3232
$swooleResponse->shouldReceive('sendfile')->with($file)->once()->andReturn(null);
33-
$swooleResponse->shouldReceive('status')->with(Mockery::any())->once()->andReturn(200);
33+
$swooleResponse->shouldReceive('status')->with(200, '')->once()->andReturn(200);
3434

3535
$response = new Response();
3636
$response = $response->withBody(new SwooleFileStream($file));
@@ -44,7 +44,7 @@ public function testSwooleStream()
4444
$swooleResponse = Mockery::mock(SwooleResponse::class);
4545
$content = '{"id":1}';
4646
$swooleResponse->shouldReceive('end')->with($content)->once()->andReturn(null);
47-
$swooleResponse->shouldReceive('status')->with(Mockery::any())->once()->andReturn(200);
47+
$swooleResponse->shouldReceive('status')->with(200, '')->once()->andReturn(200);
4848
$swooleResponse->shouldReceive('header')->with('TOKEN', 'xxx')->once()->andReturn(null);
4949

5050
$response = new Response();

0 commit comments

Comments
 (0)