setLogFile(new PathLogFile($this->fixturePath())); $log->parse(); $this->assertCount(13, $log->getEntries()); } public function testInfoBracketIsParsedAsLevel(): void { $log = (new ProjectZomboidChatLog())->setLogFile(new PathLogFile($this->fixturePath())); $log->parse(); $first = $log->getEntries()[0]; $this->assertSame(Level::INFO, $first->getLevel()); $this->assertNotNull($first->getTime()); } public function testServerAlertLinesParseWithoutLevel(): void { $log = (new ProjectZomboidChatLog())->setLogFile(new PathLogFile($this->fixturePath())); $log->parse(); $alert = $log->getEntries()[10]; $this->assertStringContainsString('Server alert message', (string) $alert); } public function testDetectiveDispatchesByContent(): void { $detective = (new Detective()) ->setLogFile(new PathLogFile($this->fixturePath())) ->addPossibleLogClass(ProjectZomboidChatLog::class); $this->assertInstanceOf(ProjectZomboidChatLog::class, $detective->detect()); } }