@@ -80,6 +80,9 @@ public function test_server_response_with_deferred_prop(): void
8080 $ this ->assertSame ('Jonathan ' , $ page ['props ' ]['user ' ]['name ' ]);
8181 $ this ->assertSame ('/user/123 ' , $ page ['url ' ]);
8282 $ this ->assertSame ('123 ' , $ page ['version ' ]);
83+ $ this ->assertSame ([
84+ 'default ' => ['foo ' ],
85+ ], $ page ['deferredProps ' ]);
8386 $ this ->assertFalse ($ page ['clearHistory ' ]);
8487 $ this ->assertFalse ($ page ['encryptHistory ' ]);
8588 $ this ->assertSame ('<div id="app" data-page="{"component":"User\/Edit","props":{"user":{"name":"Jonathan"}},"url":"\/user\/123","version":"123","clearHistory":false,"encryptHistory":false,"deferredProps":{"default":["foo"]}}"></div> ' , $ view ->render ());
@@ -118,6 +121,10 @@ public function test_server_response_with_deferred_prop_and_multiple_groups(): v
118121 $ this ->assertSame ('Jonathan ' , $ page ['props ' ]['user ' ]['name ' ]);
119122 $ this ->assertSame ('/user/123 ' , $ page ['url ' ]);
120123 $ this ->assertSame ('123 ' , $ page ['version ' ]);
124+ $ this ->assertSame ([
125+ 'default ' => ['foo ' , 'bar ' ],
126+ 'custom ' => ['baz ' ],
127+ ], $ page ['deferredProps ' ]);
121128 $ this ->assertFalse ($ page ['clearHistory ' ]);
122129 $ this ->assertFalse ($ page ['encryptHistory ' ]);
123130 $ this ->assertSame ('<div id="app" data-page="{"component":"User\/Edit","props":{"user":{"name":"Jonathan"}},"url":"\/user\/123","version":"123","clearHistory":false,"encryptHistory":false,"deferredProps":{"default":["foo","bar"],"custom":["baz"]}}"></div> ' , $ view ->render ());
@@ -149,6 +156,10 @@ public function test_server_response_with_merge_props(): void
149156 $ this ->assertSame ('Jonathan ' , $ page ['props ' ]['user ' ]['name ' ]);
150157 $ this ->assertSame ('/user/123 ' , $ page ['url ' ]);
151158 $ this ->assertSame ('123 ' , $ page ['version ' ]);
159+ $ this ->assertSame ([
160+ 'foo ' ,
161+ 'bar ' ,
162+ ], $ page ['mergeProps ' ]);
152163 $ this ->assertFalse ($ page ['clearHistory ' ]);
153164 $ this ->assertFalse ($ page ['encryptHistory ' ]);
154165 $ this ->assertSame ('<div id="app" data-page="{"component":"User\/Edit","props":{"user":{"name":"Jonathan"},"foo":"foo value","bar":"bar value"},"url":"\/user\/123","version":"123","clearHistory":false,"encryptHistory":false,"mergeProps":["foo","bar"]}"></div> ' , $ view ->render ());
@@ -182,6 +193,13 @@ public function test_server_response_with_defer_and_merge_props(): void
182193 $ this ->assertSame ('Jonathan ' , $ page ['props ' ]['user ' ]['name ' ]);
183194 $ this ->assertSame ('/user/123 ' , $ page ['url ' ]);
184195 $ this ->assertSame ('123 ' , $ page ['version ' ]);
196+ $ this ->assertSame ([
197+ 'default ' => ['foo ' ],
198+ ], $ page ['deferredProps ' ]);
199+ $ this ->assertSame ([
200+ 'foo ' ,
201+ 'bar ' ,
202+ ], $ page ['mergeProps ' ]);
185203 $ this ->assertFalse ($ page ['clearHistory ' ]);
186204 $ this ->assertFalse ($ page ['encryptHistory ' ]);
187205 $ this ->assertSame ('<div id="app" data-page="{"component":"User\/Edit","props":{"user":{"name":"Jonathan"},"bar":"bar value"},"url":"\/user\/123","version":"123","clearHistory":false,"encryptHistory":false,"mergeProps":["foo","bar"],"deferredProps":{"default":["foo"]}}"></div> ' , $ view ->render ());
0 commit comments