mirror of
https://github.com/HolgerHatGarKeineNode/einundzwanzig-app.git
synced 2026-06-17 16:40:31 +00:00
276016eed7
- 🔧 Refactor `CountryController` to safely process non-numeric values in `selected` query parameter using `array_filter`. - 🧪 Add feature test to ensure API does not crash when `selected` includes non-numeric codes.
14 lines
317 B
PHP
14 lines
317 B
PHP
<?php
|
|
|
|
use App\Models\Country;
|
|
|
|
it('does not crash when selected contains non-numeric codes', function () {
|
|
Country::factory()->create(['code' => 'CH']);
|
|
|
|
$response = $this->getJson('/api/countries?'.http_build_query([
|
|
'selected' => ['CH', 'de', '1'],
|
|
]));
|
|
|
|
$response->assertSuccessful();
|
|
});
|