shouldReceive('notify')->andReturn([]); $service = new SchoolCalendarMutationService($context, $notifier); $result = $service->create([ 'title' => 'New Event', 'date' => '2026-01-05', 'semester' => 'Fall', 'school_year' => '2025-2026', ], []); $this->assertInstanceOf(CalendarEvent::class, $result['event']); $this->assertDatabaseHas('calendar_events', ['title' => 'New Event']); } public function test_update_persists_changes(): void { $event = CalendarEvent::query()->create([ 'title' => 'Old Event', 'date' => '2026-01-01', 'description' => '', 'notify_parent' => 0, 'notify_admin' => 0, 'notify_teacher' => 0, 'no_school' => 0, 'semester' => 'Fall', 'school_year' => '2025-2026', 'notification_sent' => 0, ]); $context = new SchoolCalendarContextService(); $notifier = Mockery::mock(SchoolCalendarNotificationService::class); $notifier->shouldReceive('notify')->andReturn([]); $service = new SchoolCalendarMutationService($context, $notifier); $service->update($event, ['title' => 'Updated Event'], []); $this->assertDatabaseHas('calendar_events', [ 'id' => $event->id, 'title' => 'Updated Event', ]); } }