Skip to content

Commit fbd2afc

Browse files
committed
Tweak formatting of test
1 parent 01a82b1 commit fbd2afc

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

tests/ResponseTest.php

+11-10
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function toArray($request)
7979
$this->assertSame('123', $page->version);
8080
}
8181

82-
public function test_callable_resource_response()
82+
public function test_lazy_resource_response()
8383
{
8484
$request = Request::create('/users', 'GET', ['page' => 1]);
8585
$request->headers->add(['X-Inertia' => 'true']);
@@ -93,7 +93,8 @@ public function test_callable_resource_response()
9393
$callable = function () use ($users) {
9494
$page = new LengthAwarePaginator($users->take(2), $users->count(), 2);
9595

96-
return new class($page, JsonResource::class) extends ResourceCollection {};
96+
return new class($page, JsonResource::class) extends ResourceCollection {
97+
};
9798
};
9899

99100
$response = new Response('User/Index', ['users' => $callable], 'app', '123');
@@ -109,19 +110,19 @@ public function test_callable_resource_response()
109110
'next' => '/?page=2',
110111
],
111112
'meta' => [
112-
'current_page'=> 1,
113-
'from'=> 1,
114-
'last_page'=> 2,
115-
'path'=> '/',
116-
'per_page'=> 2,
117-
'to'=> 2,
118-
'total'=> 3,
113+
'current_page' => 1,
114+
'from' => 1,
115+
'last_page' => 2,
116+
'path' => '/',
117+
'per_page' => 2,
118+
'to' => 2,
119+
'total' => 3,
119120
],
120121
];
121122

122123
$this->assertInstanceOf(JsonResponse::class, $response);
123124
$this->assertSame('User/Index', $page->component);
124-
$this->assertSame(\json_encode($expected), \json_encode($page->props->users));
125+
$this->assertSame(json_encode($expected), json_encode($page->props->users));
125126
$this->assertSame('/users?page=1', $page->url);
126127
$this->assertSame('123', $page->version);
127128
}

0 commit comments

Comments
 (0)