23 lines
645 B
PHP
23 lines
645 B
PHP
<?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);
|
|
});
|