Ejemplo n.º 1
0
 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());
 }
Ejemplo n.º 2
0
 /**
  * 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()}");
     }
 }