19 declare(strict_types=1);
42 $stream = Streams::ofString(
'Awesome stuff');
43 $mock = $this->getMockBuilder(\ilVirusScanner::class)
44 ->disableOriginalConstructor()
46 $mock->expects($this->once())->method(
'scanFile')->with($stream->getMetadata(
'uri'))->willReturn(
51 $result = $subject->process(
53 new Metadata(
'MyVirus.exe', $stream->getSize(),
'application/vnd.microsoft.portable-executable')
55 $this->assertSame(ProcessingStatus::DENIED, $result->getCode());
56 $this->assertSame(
'Virus detected.', $result->getMessage());
61 $stream = Streams::ofString(
'Awesome stuff');
63 $mock = $this->getMockBuilder(\ilVirusScanner::class)
64 ->disableOriginalConstructor()
66 $mock->expects($this->once())->method(
'scanFile')->with($stream->getMetadata(
'uri'))->willReturn(
'');
69 $result = $subject->process(
71 new Metadata(
'MyVirus.exe', $stream->getSize(),
'application/vnd.microsoft.portable-executable')
73 $this->assertSame(ProcessingStatus::OK, $result->getCode());
disabled disabled disabled