Files
ppeasy_vg12/tests/Unit/Repositories/Country/EloquentCountryTest.php
T
2026-10-09 08:21:06 +02:00

21 lines
526 B
PHP

<?php
use App\Models\Country;
use App\Repositories\Country\EloquentCountry;
use Illuminate\Foundation\Testing\RefreshDatabase;
uses(RefreshDatabase::class);
beforeEach(function () {
$this->repo = app(EloquentCountry::class);
});
test('lists', function () {
$countries = Country::factory()->times(8)->create();
$countries = $countries->sortBy(function ($country) {
return $country->name;
})->pluck('name', 'id');
$this->assertEquals($countries->toArray(), $this->repo->lists()->toArray());
});