public function assertHasPagination($response, $values = [])
{
$response->assertJsonStructure([
'links' => [
'first',
'last',
'prev',
'next',
]
]);
$response->assertJsonStructure([
'meta' => [
'current_page',
'from',
'last_page',
'path',
'per_page',
'to',
'total',
]
]);
if(count($values) == 0) return;
foreach($values as $key => $value) {
$response->assertJsonPath("meta.$key", $value);
}
}
-
-
Save vamuigua/535ae2db19e07fc02d4f67e176e60f80 to your computer and use it in GitHub Desktop.
Assert Laravel Pagination - Add helper to Testcase.php
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment