|
7 | 7 | // tags: expert |
8 | 8 | // --- |
9 | 9 |
|
10 | | -// In case you're using a custom collection (through a Provider), make sure you return the `Paginator` object to get the full hydra response with `hydra:view` (which contains information about first, last, next and previous page). |
| 10 | +// In case you're using a custom collection (through a Provider), make sure you return the `Paginator` object to get the full hydra response with `view` (which contains information about first, last, next and previous page). |
11 | 11 | // |
12 | 12 | // The following example shows how to handle it using a custom Provider. You will need to use the Doctrine Paginator and pass it to the API Platform Paginator. |
13 | 13 |
|
@@ -160,15 +160,15 @@ public function testTheCustomCollectionIsPaginated(): void |
160 | 160 |
|
161 | 161 | $this->assertResponseIsSuccessful(); |
162 | 162 | $this->assertMatchesResourceCollectionJsonSchema(Book::class, '_api_/books{._format}_get_collection', 'jsonld'); |
163 | | - $this->assertNotSame(0, $response->toArray(false)['hydra:totalItems'], 'The collection is empty.'); |
| 163 | + $this->assertNotSame(0, $response->toArray(false)['totalItems'], 'The collection is empty.'); |
164 | 164 | $this->assertJsonContains([ |
165 | | - 'hydra:totalItems' => 35, |
166 | | - 'hydra:view' => [ |
| 165 | + 'totalItems' => 35, |
| 166 | + 'view' => [ |
167 | 167 | '@id' => '/books.jsonld?page=1', |
168 | | - '@type' => 'hydra:PartialCollectionView', |
169 | | - 'hydra:first' => '/books.jsonld?page=1', |
170 | | - 'hydra:last' => '/books.jsonld?page=2', |
171 | | - 'hydra:next' => '/books.jsonld?page=2', |
| 168 | + '@type' => 'PartialCollectionView', |
| 169 | + 'first' => '/books.jsonld?page=1', |
| 170 | + 'last' => '/books.jsonld?page=2', |
| 171 | + 'next' => '/books.jsonld?page=2', |
172 | 172 | ], |
173 | 173 | ]); |
174 | 174 | } |
|
0 commit comments