File tree Expand file tree Collapse file tree
src/swoole-nyholm/tests/Unit Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ public function testHandle(): void
3131 $ factory = $ this ->createMock (ServerFactory::class);
3232 $ application = $ this ->createMock (RequestHandlerInterface::class);
3333 $ psrResponse = $ this ->createMock (ResponseInterface::class);
34+ $ psrResponseInner = $ this ->createMock (ResponseInterface::class);
3435 $ request = $ this ->createMock (Request::class);
3536 $ response = $ this ->createMock (Response::class);
3637
@@ -39,9 +40,10 @@ public function testHandle(): void
3940
4041 $ application ->expects (self ::once ())->method ('handle ' )->willReturn ($ psrResponse );
4142
42- $ psrResponse ->expects (self ::once ())->method ('getHeaders ' )->willReturn ([
43+ $ psrResponseInner ->expects (self ::once ())->method ('getHeaders ' )->willReturn ([
4344 'X-Test ' => ['Swoole-Runtime ' ],
4445 ]);
46+ $ psrResponse ->expects (self ::once ())->method ('withoutHeader ' )->willReturn ($ psrResponseInner );
4547 $ psrResponse ->expects (self ::once ())->method ('getBody ' )->willReturn (Stream::create ('Test ' ));
4648 $ psrResponse ->expects (self ::once ())->method ('getStatusCode ' )->willReturn (200 );
4749 $ psrResponse ->expects (self ::once ())->method ('getReasonPhrase ' )->willReturn ('OK ' );
You can’t perform that action at this time.
0 commit comments