From a14bfbf1689ab68859648d12d1bf4b3e32cd7918 Mon Sep 17 00:00:00 2001 From: Matt Young Date: Fri, 12 Jul 2024 12:14:37 -0500 Subject: [PATCH] Create EntryServiceTest.php --- tests/Feature/Services/EntryServiceTest.php | 24 +++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/Feature/Services/EntryServiceTest.php diff --git a/tests/Feature/Services/EntryServiceTest.php b/tests/Feature/Services/EntryServiceTest.php new file mode 100644 index 0000000..f26245f --- /dev/null +++ b/tests/Feature/Services/EntryServiceTest.php @@ -0,0 +1,24 @@ +entryService = App::make(EntryService::class); +}); + +it('checks if an entry is late', function() { + $openAudition = Audition::factory()->create(['entry_deadline' => Carbon::tomorrow()]); + $closedAudition = Audition::factory()->create(['entry_deadline' => Carbon::yesterday()]); + + $onTime = Entry::factory()->create(['audition_id' => $openAudition->id]); + $late = Entry::factory()->create(['audition_id' => $closedAudition]); + expect($this->entryService->isEntryLate($onTime))->toBeFalse(); + expect($this->entryService->isEntryLate($late))->toBeTrue(); +});