assertStringStartsWith('assertFalse( str_starts_with($view, ' tag.' ); } /** * The timer must be database backed rather than session/localStorage backed. */ public function test_ticket_timer_is_not_session_or_local_storage_backed(): void { $component = (string) file_get_contents(base_path('Modules/Helpdesk/Livewire/TicketTimer.php')); $view = (string) file_get_contents(base_path('Modules/Helpdesk/resources/views/livewire/ticket-timer.blade.php')); $this->assertStringNotContainsString('session(', $component); $this->assertStringNotContainsString('localStorage', $component); $this->assertStringNotContainsString('localStorage', $view); $this->assertStringContainsString('whereNull', $component); $this->assertStringContainsString('activeUserTimerQuery', $component); $this->assertStringContainsString('TicketTimeLog::query()', $component); $this->assertStringNotContainsString('->timeLogs()', $component); } /** * The ticket page must include the user-specific timer partial. */ public function test_ticket_show_timer_partial_exists(): void { $this->assertFileExists(base_path('Modules/Helpdesk/resources/views/partials/ticket-time-timer.blade.php')); $this->assertFileExists(base_path('Modules/Helpdesk/resources/views/livewire/ticket-timer.blade.php')); $this->assertFileExists(base_path('Modules/Helpdesk/Livewire/TicketTimer.php')); } }