mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-29 12:41:10 -04:00
v5.0.0 update
This commit is contained in:
20
tests/Unit/Model/CountryTest.php
Normal file
20
tests/Unit/Model/CountryTest.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
use Crater\Models\Address;
|
||||
use Crater\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());
|
||||
});
|
||||
Reference in New Issue
Block a user