Skip to content

Commit e11fb29

Browse files
committed
fix: method test filter entity in nova template
1 parent 3447294 commit e11fb29

File tree

3 files changed

+6
-21
lines changed

3 files changed

+6
-21
lines changed

Dockerfile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
11
FROM webdevops/php-nginx-dev:7.4
2-
3-
RUN wget -O "/usr/local/bin/go-replace" "https://github.com/webdevops/goreplace/releases/download/1.1.2/gr-arm64-linux" \
4-
&& chmod +x "/usr/local/bin/go-replace" \
5-
&& "/usr/local/bin/go-replace" --version

tests/Support/NovaTestMockTrait.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -159,13 +159,4 @@ public function mockFilesystem(): void
159159

160160
vfsStream::create($structure);
161161
}
162-
163-
public function novaSearchParams(array $filters, string $search = '', int $perPage = 25): array
164-
{
165-
return [
166-
'search' => $search,
167-
'filters' => base64_encode(json_encode($filters)),
168-
'perPage' => $perPage
169-
];
170-
}
171162
}

tests/fixtures/NovaTestGeneratorTest/created_resource_test.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,14 +251,14 @@ public function getPostFiltersData(): array
251251
{
252252
return [
253253
[
254-
'filters' => [
255-
'TextField:description_field' => ['search term'],
254+
'request' => [
255+
'TextField:description_field' => $this->novaSearchParams(['search term']),
256256
],
257257
'response_fixture' => 'filter_post_by_text_field.json',
258258
],
259259
[
260-
'filters' => [
261-
'RonasIT\Support\Tests\Support\CreatedAtFilter' => ['search term'],
260+
'request' => [
261+
'RonasIT\Support\Tests\Support\CreatedAtFilter' => $this->novaSearchParams(['search term']),
262262
],
263263
'response_fixture' => 'filter_post_by_created_at_filter.json',
264264
],
@@ -268,11 +268,9 @@ public function getPostFiltersData(): array
268268
/**
269269
* @dataProvider getPostFiltersData
270270
*/
271-
public function testFilterPost(array $filters, string $responseFixture): void
271+
public function testFilterPost(array $request, string $responseFixture): void
272272
{
273-
$response = $this->actingAs(self::$user, 'web')->json('get', '/nova-api/post-resources', [
274-
'filters' => base64_encode(json_encode($filters))
275-
]);
273+
$response = $this->actingAs(self::$user, 'web')->json('get', '/nova-api/post-resources', $request);
276274

277275
$response->assertOk();
278276

0 commit comments

Comments
 (0)