Files
InvoiceShelf/tests/Unit/CountryTest.php
Darko Gjorgjijoski 6b80b5f48d Change namespace
2024-01-27 23:53:20 +01:00

21 lines
546 B
PHP

<?php
use InvoiceShelf\Models\Address;
use InvoiceShelf\Models\Country;
use Illuminate\Support\Facades\Artisan;
beforeEach(function () {
Artisan::call('db:seed', ['--class' => 'DatabaseSeeder', '--force' => true]);
Artisan::call('db:seed', ['--class' => 'DemoSeeder', '--force' => true]);
});
test('country has many addresses', function () {
$country = Country::find(1);
$address = Address::factory()->count(5)->create([
'country_id' => $country->id,
]);
$this->assertTrue($country->address()->exists());
});