We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 190e70e commit c17b2a7Copy full SHA for c17b2a7
1 file changed
tests/Feature/Filters/AdvancedFilterTest.php
@@ -14,6 +14,7 @@
14
use Binaryk\LaravelRestify\Tests\Fixtures\User\UserRepository;
15
use Binaryk\LaravelRestify\Tests\IntegrationTestCase;
16
use Illuminate\Testing\Fluent\AssertableJson;
17
+use JsonException;
18
19
class AdvancedFilterTest extends IntegrationTestCase
20
{
@@ -288,4 +289,17 @@ public function test_index_with_null_filters_query_param_returns_all_results():
288
289
->assertOk()
290
->assertJsonCount(3, 'data');
291
}
292
+
293
+ public function test_index_with_invalid_json_filters_throws_json_exception(): void
294
+ {
295
+ $this->withoutExceptionHandling();
296
297
+ $this->expectException(JsonException::class);
298
299
+ $filters = base64_encode('invalid-json{');
300
301
+ $this->getJson(PostRepository::route(query: [
302
+ 'filters' => $filters,
303
+ ]));
304
+ }
305
0 commit comments