setLogFile(new PathLogFile($this->fixturePath())); $log->parse(); $this->assertCount(10, $log->getEntries()); } public function testFieldsRegexExtractsCommand(): void { $line = '[16-04-26 16:19:30.812] 76561198000000003 "AdminUser" admin.kickPlayer @ 1020,2020,0.'; $this->assertSame(1, preg_match(CmdPattern::FIELDS, $line, $m)); $this->assertSame('AdminUser', $m['player']); $this->assertSame('admin.kickPlayer', $m['command']); } public function testDetectiveDispatchesByContent(): void { $detective = (new Detective()) ->setLogFile(new PathLogFile($this->fixturePath())) ->addPossibleLogClass(ProjectZomboidCmdLog::class); $this->assertInstanceOf(ProjectZomboidCmdLog::class, $detective->detect()); } }