Total Complexity | 4 |
Total Lines | 51 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
9 | trait AssertPagination |
||
10 | { |
||
11 | /** |
||
12 | * @param $response |
||
13 | * @param $expectedCount |
||
14 | */ |
||
15 | protected function assertPaginationFormat(TestResponse $response, $expectedCount, $expectedTotal) |
||
25 | } |
||
26 | |||
27 | /** |
||
28 | * @param TestResponse $response |
||
29 | * @param $total |
||
30 | */ |
||
31 | protected function assertPaginationResponseStructure(TestResponse $response, $total) |
||
32 | { |
||
33 | $this->assertMatchesRegularExpression( |
||
34 | "/" . View::file( |
||
35 | config('digitonic.api-test-suite.templates.base_path') . 'pagination/pagination.blade.php', |
||
36 | [ |
||
37 | 'total' => $total |
||
38 | ] |
||
39 | )->render() . "/", |
||
40 | $response->getContent(), |
||
41 | 'Pagination response structure doesn\'t follow the template set up in ' |
||
42 | .config('digitonic.api-test-suite.templates.base_path').' pagination/pagination.blade.php.' |
||
43 | ); |
||
44 | } |
||
45 | |||
46 | /** |
||
47 | * @return float |
||
48 | */ |
||
49 | protected function entitiesNumber() |
||
50 | { |
||
51 | return 1.5 * $this->entitiesPerPage(); |
||
52 | } |
||
53 | |||
54 | /** |
||
55 | * @return int |
||
56 | */ |
||
57 | protected function entitiesPerPage() |
||
60 | } |
||
61 | } |
||
62 |