18 lines
499 B
PHP
18 lines
499 B
PHP
<?php
|
|
|
|
use App\Models\School;
|
|
use App\Models\SchoolEmailDomain;
|
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
|
|
|
uses(RefreshDatabase::class);
|
|
|
|
beforeEach(function () {
|
|
$this->school = School::factory()->create();
|
|
$this->school->emailDomains()->create(['domain' => 'test.com']);
|
|
});
|
|
|
|
it('returns its school', function () {
|
|
expect(SchoolEmailDomain::first()->school->id)->toEqual($this->school->id)
|
|
->and(SchoolEmailDomain::first()->school)->toBeInstanceOf(School::class);
|
|
});
|