public function testGetDetections() { $path = 'foobar1.txt'; $files = ['foobar1.txt']; $detections = $files; $scanResult = new ScanResult([$path], $files, $detections); $this->assertEquals($detections, $scanResult->getDetections()); $this->assertTrue($scanResult->hasVirus()); }
/** * Log a virus detection. * * @param ScanResult $result */ private function logInfections($result) { foreach ($result->getDetections() as $d) { $this->logger->error("VIRUS DETECTED: {$d->getPath()} - {$d->getDescription()}"); } }