Create tests for app/Models/SchoolEmailDomain
This commit is contained in:
parent
08fd7a215a
commit
9b8584777e
|
|
@ -0,0 +1,17 @@
|
||||||
|
<?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);
|
||||||
|
});
|
||||||
Loading…
Reference in New Issue