6
6
use Illuminate \View \View ;
7
7
use Illuminate \Http \Request ;
8
8
use Illuminate \Http \JsonResponse ;
9
+ use Illuminate \Http \Response as BaseResponse ;
9
10
10
11
class ResponseTest extends TestCase
11
12
{
@@ -21,14 +22,17 @@ public function test_server_response()
21
22
);
22
23
23
24
$ response = $ response ->toResponse ($ request );
24
- $ page = $ response ->getData ()['page ' ];
25
+ $ view = $ response ->getOriginalContent ();
26
+ $ page = $ view ->getData ()['page ' ];
27
+
28
+ $ this ->assertInstanceOf (BaseResponse::class, $ response );
29
+ $ this ->assertInstanceOf (View::class, $ view );
25
30
26
- $ this ->assertInstanceOf (View::class, $ response );
27
31
$ this ->assertSame ('User/Edit ' , $ page ['component ' ]);
28
32
$ this ->assertSame ('Jonathan ' , $ page ['props ' ]['user ' ]['name ' ]);
29
33
$ this ->assertSame ('/user/123 ' , $ page ['url ' ]);
30
34
$ this ->assertSame ('123 ' , $ page ['version ' ]);
31
- $ this ->assertSame ('<div id="app" data-page="{"component":"User\/Edit","props":{"user":{"name":"Jonathan"}},"url":"\/user\/123","version":"123"}"></div> ' ."\n" , $ response ->render ());
35
+ $ this ->assertSame ('<div id="app" data-page="{"component":"User\/Edit","props":{"user":{"name":"Jonathan"}},"url":"\/user\/123","version":"123"}"></div> ' ."\n" , $ view ->render ());
32
36
}
33
37
34
38
public function test_xhr_response ()
0 commit comments