Create tests for app/Models/EntryTotalScore
This commit is contained in:
parent
899299fd99
commit
fe9c3612be
|
|
@ -0,0 +1,22 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use App\Models\EntryTotalScore;
|
||||||
|
use Illuminate\Foundation\Testing\RefreshDatabase;
|
||||||
|
|
||||||
|
uses(RefreshDatabase::class);
|
||||||
|
|
||||||
|
beforeEach(function () {
|
||||||
|
$this->entry = \App\Models\Entry::factory()->create();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('can return its entry', function () {
|
||||||
|
DB::table('entry_total_scores')->insert([
|
||||||
|
'entry_id' => $this->entry->id,
|
||||||
|
'seating_total' => 3,
|
||||||
|
'advancement_total' => 4,
|
||||||
|
'seating_subscore_totals' => json_encode([22, 2]),
|
||||||
|
'advancement_subscore_totals' => json_encode([22, 2]),
|
||||||
|
'bonus_total' => null,
|
||||||
|
]);
|
||||||
|
expect(EntryTotalScore::first()->entry->id)->toEqual($this->entry->id);
|
||||||
|
});
|
||||||
Loading…
Reference in New Issue