From fe9c3612beb4ebb43061c357d22defe066027cd9 Mon Sep 17 00:00:00 2001 From: Matt Young Date: Thu, 3 Jul 2025 14:22:17 -0500 Subject: [PATCH] Create tests for app/Models/EntryTotalScore --- .../app/Models/EntryTotalScoreTest.php | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/Feature/app/Models/EntryTotalScoreTest.php diff --git a/tests/Feature/app/Models/EntryTotalScoreTest.php b/tests/Feature/app/Models/EntryTotalScoreTest.php new file mode 100644 index 0000000..f74e40f --- /dev/null +++ b/tests/Feature/app/Models/EntryTotalScoreTest.php @@ -0,0 +1,22 @@ +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); +});