Files
ppeasy_vg12/tests/Feature/Api/CountriesControllerTest.php
T
2026-10-09 08:21:06 +02:00

19 lines
408 B
PHP

<?php
use App\Http\Resources\CountryResource;
use App\Models\Country;
test('unauthenticated', function () {
$this->getJson('/api/countries')->assertStatus(401);
});
test('get all countries', function () {
$this->login();
$this->getJson('/api/countries')
->assertOk()
->assertJson([
'data' => CountryResource::collection(Country::all())->resolve(),
]);
});