21 lines
526 B
PHP
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());
|
|
});
|