@@ -80,6 +80,9 @@ public function test_server_response_with_deferred_prop(): void
80
80
$ this ->assertSame ('Jonathan ' , $ page ['props ' ]['user ' ]['name ' ]);
81
81
$ this ->assertSame ('/user/123 ' , $ page ['url ' ]);
82
82
$ this ->assertSame ('123 ' , $ page ['version ' ]);
83
+ $ this ->assertSame ([
84
+ 'default ' => ['foo ' ],
85
+ ], $ page ['deferredProps ' ]);
83
86
$ this ->assertFalse ($ page ['clearHistory ' ]);
84
87
$ this ->assertFalse ($ page ['encryptHistory ' ]);
85
88
$ 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
118
121
$ this ->assertSame ('Jonathan ' , $ page ['props ' ]['user ' ]['name ' ]);
119
122
$ this ->assertSame ('/user/123 ' , $ page ['url ' ]);
120
123
$ this ->assertSame ('123 ' , $ page ['version ' ]);
124
+ $ this ->assertSame ([
125
+ 'default ' => ['foo ' , 'bar ' ],
126
+ 'custom ' => ['baz ' ],
127
+ ], $ page ['deferredProps ' ]);
121
128
$ this ->assertFalse ($ page ['clearHistory ' ]);
122
129
$ this ->assertFalse ($ page ['encryptHistory ' ]);
123
130
$ 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
149
156
$ this ->assertSame ('Jonathan ' , $ page ['props ' ]['user ' ]['name ' ]);
150
157
$ this ->assertSame ('/user/123 ' , $ page ['url ' ]);
151
158
$ this ->assertSame ('123 ' , $ page ['version ' ]);
159
+ $ this ->assertSame ([
160
+ 'foo ' ,
161
+ 'bar ' ,
162
+ ], $ page ['mergeProps ' ]);
152
163
$ this ->assertFalse ($ page ['clearHistory ' ]);
153
164
$ this ->assertFalse ($ page ['encryptHistory ' ]);
154
165
$ 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
182
193
$ this ->assertSame ('Jonathan ' , $ page ['props ' ]['user ' ]['name ' ]);
183
194
$ this ->assertSame ('/user/123 ' , $ page ['url ' ]);
184
195
$ this ->assertSame ('123 ' , $ page ['version ' ]);
196
+ $ this ->assertSame ([
197
+ 'default ' => ['foo ' ],
198
+ ], $ page ['deferredProps ' ]);
199
+ $ this ->assertSame ([
200
+ 'foo ' ,
201
+ 'bar ' ,
202
+ ], $ page ['mergeProps ' ]);
185
203
$ this ->assertFalse ($ page ['clearHistory ' ]);
186
204
$ this ->assertFalse ($ page ['encryptHistory ' ]);
187
205
$ 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