@@ -24,7 +24,7 @@ class ResponseFactoryTest extends TestCase
24
24
{
25
25
public function test_can_macro (): void
26
26
{
27
- $ factory = new ResponseFactory () ;
27
+ $ factory = new ResponseFactory ;
28
28
$ factory ->macro ('foo ' , function () {
29
29
return 'bar ' ;
30
30
});
@@ -38,7 +38,7 @@ public function test_location_response_for_inertia_requests(): void
38
38
return true ;
39
39
});
40
40
41
- $ response = (new ResponseFactory () )->location ('https://inertiajs.com ' );
41
+ $ response = (new ResponseFactory )->location ('https://inertiajs.com ' );
42
42
43
43
$ this ->assertInstanceOf (Response::class, $ response );
44
44
$ this ->assertEquals (Response::HTTP_CONFLICT , $ response ->getStatusCode ());
@@ -51,7 +51,7 @@ public function test_location_response_for_non_inertia_requests(): void
51
51
return false ;
52
52
});
53
53
54
- $ response = (new ResponseFactory () )->location ('https://inertiajs.com ' );
54
+ $ response = (new ResponseFactory )->location ('https://inertiajs.com ' );
55
55
56
56
$ this ->assertInstanceOf (RedirectResponse::class, $ response );
57
57
$ this ->assertEquals (Response::HTTP_FOUND , $ response ->getStatusCode ());
@@ -65,7 +65,7 @@ public function test_location_response_for_inertia_requests_using_redirect_respo
65
65
});
66
66
67
67
$ redirect = new RedirectResponse ('https://inertiajs.com ' );
68
- $ response = (new ResponseFactory () )->location ($ redirect );
68
+ $ response = (new ResponseFactory )->location ($ redirect );
69
69
70
70
$ this ->assertInstanceOf (Response::class, $ response );
71
71
$ this ->assertEquals (409 , $ response ->getStatusCode ());
@@ -75,7 +75,7 @@ public function test_location_response_for_inertia_requests_using_redirect_respo
75
75
public function test_location_response_for_non_inertia_requests_using_redirect_response (): void
76
76
{
77
77
$ redirect = new RedirectResponse ('https://inertiajs.com ' );
78
- $ response = (new ResponseFactory () )->location ($ redirect );
78
+ $ response = (new ResponseFactory )->location ($ redirect );
79
79
80
80
$ this ->assertInstanceOf (RedirectResponse::class, $ response );
81
81
$ this ->assertEquals (Response::HTTP_FOUND , $ response ->getStatusCode ());
@@ -84,7 +84,7 @@ public function test_location_response_for_non_inertia_requests_using_redirect_r
84
84
85
85
public function test_location_redirects_are_not_modified (): void
86
86
{
87
- $ response = (new ResponseFactory () )->location ('/foo ' );
87
+ $ response = (new ResponseFactory )->location ('/foo ' );
88
88
89
89
$ this ->assertInstanceOf (RedirectResponse::class, $ response );
90
90
$ this ->assertEquals (Response::HTTP_FOUND , $ response ->getStatusCode ());
@@ -96,7 +96,7 @@ public function test_location_response_for_non_inertia_requests_using_redirect_r
96
96
$ redirect = new RedirectResponse ('https://inertiajs.com ' );
97
97
$ redirect ->setSession ($ session = new Store ('test ' , new NullSessionHandler ));
98
98
$ redirect ->setRequest ($ request = new HttpRequest );
99
- $ response = (new ResponseFactory () )->location ($ redirect );
99
+ $ response = (new ResponseFactory )->location ($ redirect );
100
100
101
101
$ this ->assertInstanceOf (RedirectResponse::class, $ response );
102
102
$ this ->assertEquals (Response::HTTP_FOUND , $ response ->getStatusCode ());
@@ -156,7 +156,7 @@ public function test_can_flush_shared_data(): void
156
156
157
157
public function test_can_create_lazy_prop (): void
158
158
{
159
- $ factory = new ResponseFactory () ;
159
+ $ factory = new ResponseFactory ;
160
160
$ lazyProp = $ factory ->lazy (function () {
161
161
return 'A lazy value ' ;
162
162
});
@@ -166,7 +166,7 @@ public function test_can_create_lazy_prop(): void
166
166
167
167
public function test_can_create_deferred_prop (): void
168
168
{
169
- $ factory = new ResponseFactory () ;
169
+ $ factory = new ResponseFactory ;
170
170
$ deferredProp = $ factory ->defer (function () {
171
171
return 'A deferred value ' ;
172
172
});
@@ -177,7 +177,7 @@ public function test_can_create_deferred_prop(): void
177
177
178
178
public function test_can_create_deferred_prop_with_custom_group (): void
179
179
{
180
- $ factory = new ResponseFactory () ;
180
+ $ factory = new ResponseFactory ;
181
181
$ deferredProp = $ factory ->defer (function () {
182
182
return 'A deferred value ' ;
183
183
}, 'foo ' );
@@ -188,7 +188,7 @@ public function test_can_create_deferred_prop_with_custom_group(): void
188
188
189
189
public function test_can_create_merged_prop (): void
190
190
{
191
- $ factory = new ResponseFactory () ;
191
+ $ factory = new ResponseFactory ;
192
192
$ mergedProp = $ factory ->merge (function () {
193
193
return 'A merged value ' ;
194
194
});
@@ -198,7 +198,7 @@ public function test_can_create_merged_prop(): void
198
198
199
199
public function test_can_create_deferred_and_merged_prop (): void
200
200
{
201
- $ factory = new ResponseFactory () ;
201
+ $ factory = new ResponseFactory ;
202
202
$ deferredProp = $ factory ->defer (function () {
203
203
return 'A deferred + merged value ' ;
204
204
})->merge ();
@@ -208,7 +208,7 @@ public function test_can_create_deferred_and_merged_prop(): void
208
208
209
209
public function test_can_create_optional_prop (): void
210
210
{
211
- $ factory = new ResponseFactory () ;
211
+ $ factory = new ResponseFactory ;
212
212
$ optionalProp = $ factory ->optional (function () {
213
213
return 'An optional value ' ;
214
214
});
@@ -218,7 +218,7 @@ public function test_can_create_optional_prop(): void
218
218
219
219
public function test_can_create_always_prop (): void
220
220
{
221
- $ factory = new ResponseFactory () ;
221
+ $ factory = new ResponseFactory ;
222
222
$ alwaysProp = $ factory ->always (function () {
223
223
return 'An always value ' ;
224
224
});
@@ -231,7 +231,7 @@ public function test_will_accept_arrayabe_props()
231
231
Route::middleware ([StartSession::class, ExampleMiddleware::class])->get ('/ ' , function () {
232
232
Inertia::share ('foo ' , 'bar ' );
233
233
234
- return Inertia::render ('User/Edit ' , new class () implements Arrayable
234
+ return Inertia::render ('User/Edit ' , new class implements Arrayable
235
235
{
236
236
public function toArray ()
237
237
{
0 commit comments