|
2 | 2 |
|
3 | 3 | namespace Lampager\Laravel\Tests; |
4 | 4 |
|
| 5 | +use Illuminate\Http\Request; |
5 | 6 | use Illuminate\Http\Resources\Json\AnonymousResourceCollection; |
6 | 7 | use Illuminate\Support\Arr; |
7 | 8 |
|
@@ -111,11 +112,11 @@ public function testStructuredArrayOutput() |
111 | 112 | $this->assertResultSame($expected, (new StructuredPostResourceCollection($standardPagination))->resolve()); |
112 | 113 |
|
113 | 114 | $this->assertResultSame($expected, (new StructuredPostResourceCollection($records)) |
114 | | - ->toResponse(null)->getData() |
| 115 | + ->toResponse(Request::create('/'))->getData() |
115 | 116 | ); |
116 | 117 | $this->assertResultSame($expected, (new PostResourceCollection($records)) |
117 | 118 | ->additional(['post_resource_collection' => true]) |
118 | | - ->toResponse(null)->getData() |
| 119 | + ->toResponse(Request::create('/'))->getData() |
119 | 120 | ); |
120 | 121 | } |
121 | 122 |
|
@@ -154,11 +155,11 @@ public function testLampagerPaginationOutput() |
154 | 155 | $pagination = $this->getLampagerPagination(); |
155 | 156 |
|
156 | 157 | $this->assertResultSame($expected1, (new StructuredPostResourceCollection($pagination)) |
157 | | - ->toResponse(null)->getData() |
| 158 | + ->toResponse(Request::create('/'))->getData() |
158 | 159 | ); |
159 | 160 | $this->assertResultSame($expected2, (new PostResourceCollection($pagination)) |
160 | 161 | ->additional(['post_resource_collection' => true]) |
161 | | - ->toResponse(null)->getData() |
| 162 | + ->toResponse(Request::create('/'))->getData() |
162 | 163 | ); |
163 | 164 | } |
164 | 165 |
|
@@ -206,11 +207,11 @@ public function testStandardPaginationOutput() |
206 | 207 | $pagination = $this->getStandardPagination(); |
207 | 208 |
|
208 | 209 | $this->assertResultSame($expected1, (new StructuredPostResourceCollection($pagination)) |
209 | | - ->toResponse(null)->getData() |
| 210 | + ->toResponse(Request::create('/'))->getData() |
210 | 211 | ); |
211 | 212 | $this->assertResultSame($expected2, (new PostResourceCollection($pagination)) |
212 | 213 | ->additional(['post_resource_collection' => true]) |
213 | | - ->toResponse(null)->getData() |
| 214 | + ->toResponse(Request::create('/'))->getData() |
214 | 215 | ); |
215 | 216 | } |
216 | 217 |
|
@@ -256,6 +257,6 @@ public function testAnonymousResourceCollection() |
256 | 257 | 'has_next' => true, |
257 | 258 | 'next_cursor' => ['updated_at' => '2017-01-01 11:00:00', 'id' => 4], |
258 | 259 | ]; |
259 | | - $this->assertResultSame($expected, $collection->toResponse(null)->getData()); |
| 260 | + $this->assertResultSame($expected, $collection->toResponse(Request::create('/'))->getData()); |
260 | 261 | } |
261 | 262 | } |
0 commit comments