1616class ControllerTest
1717 extends TestCase
1818{
19-
2019 /**
2120 * @runInSeparateProcess
2221 * @throws \Throwable
@@ -33,11 +32,11 @@ function test_error()
3332
3433 $ response = (new App ($ config ))->call ('web ' );
3534
36- $ result = json_decode ($ response ->body );
35+ $ result = json_decode (( string ) $ response ->body );
3736
3837 $ this ->assertInstanceOf (Response::class, $ response );
3938 $ this ->assertEquals (404 , $ response ->status );
40- $ this ->assertEquals ('application/json ' , $ response ->header ( 'content-type ' ) );
39+ $ this ->assertEquals ('application/json ' , $ response ->headers [ 'content-type ' ] );
4140 $ this ->assertEquals ('Not Found ' , $ response ->reason );
4241 $ this ->assertEquals ('Not Found ' , $ result ->message );
4342 $ this ->assertEquals ('The server can not find the requested resource. ' , $ result ->description );
@@ -60,7 +59,7 @@ function test_exception()
6059
6160 $ response = (new App ($ config ))->call ('exception\response ' , ['exception ' => new \Exception ('foobar ' )]);
6261
63- $ result = json_decode ($ response ->body );
62+ $ result = json_decode (( string ) $ response ->body );
6463
6564 $ this ->assertInstanceOf (Response::class, $ response );
6665 $ this ->assertEquals (500 , $ response ->status );
@@ -84,15 +83,15 @@ function test_exception_trace()
8483
8584 $ response = (new App ($ config ))->call ('exception\response ' , ['exception ' => new \Exception ('foobar ' , 900 )]);
8685
87- $ result = json_decode ($ response ->body );
86+ $ result = json_decode (( string ) $ response ->body );
8887
8988 $ this ->assertInstanceOf (Response::class, $ response );
9089 $ this ->assertEquals (500 , $ response ->status );
9190 $ this ->assertEquals ('application/json ' , $ response ->headers ['content-type ' ]);
9291 $ this ->assertEquals ('Internal Server Error ' , $ response ->reason );
9392 $ this ->assertEquals (900 , $ result ->code );
9493 $ this ->assertEquals ('foobar ' , $ result ->message );
95- $ this ->assertEquals (85 , $ result ->line );
94+ $ this ->assertEquals (84 , $ result ->line );
9695 $ this ->assertEquals (__FILE__ , $ result ->file );
9796 $ this ->assertInternalType ('array ' , $ result ->trace );
9897 $ this ->assertNotEmpty ($ result ->trace );
@@ -116,7 +115,7 @@ function test_post_form()
116115
117116 $ response = (new App ($ config ))->call ('web ' );
118117
119- $ result = json_decode ($ response ->body );
118+ $ result = json_decode (( string ) $ response ->body );
120119
121120 $ this ->assertInstanceOf (Response::class, $ response );
122121 $ this ->assertEquals (200 , $ response ->status );
@@ -144,7 +143,7 @@ function test_post_json()
144143
145144 $ response = (new App ($ config ))->call ('web ' );
146145
147- $ result = json_decode ($ response ->body );
146+ $ result = json_decode (( string ) $ response ->body );
148147
149148 $ this ->assertInstanceOf (Response::class, $ response );
150149 $ this ->assertEquals (200 , $ response ->status );
0 commit comments