Class VirusScannerPreProcessorTest.
More...
◆ testNoVirusDetected()
VirusScannerPreProcessorTest::testNoVirusDetected |
( |
| ) |
|
Definition at line 56 of file VirusScannerPreProcessorTest.php.
58 $stream = Streams::ofString(
'Awesome stuff');
60 $mock = $this->getMockBuilder(\ilVirusScanner::class)
61 ->disableOriginalConstructor()
63 $mock->expects($this->once())->method(
'scanFile')->with($stream->getMetadata(
'uri'))->willReturn(
"");
66 $result = $subject->process($stream,
new Metadata(
"MyVirus.exe", $stream->getSize(),
'application/vnd.microsoft.portable-executable'));
67 $this->assertSame(ProcessingStatus::OK, $result->getCode());
◆ testVirusDetected()
VirusScannerPreProcessorTest::testVirusDetected |
( |
| ) |
|
Definition at line 41 of file VirusScannerPreProcessorTest.php.
43 $stream = Streams::ofString(
'Awesome stuff');
44 $mock = $this->getMockBuilder(\ilVirusScanner::class)
45 ->disableOriginalConstructor()
47 $mock->expects($this->once())->method(
'scanFile')->with($stream->getMetadata(
'uri'))->willReturn(
"Virus found!!!");
50 $result = $subject->process($stream,
new Metadata(
"MyVirus.exe", $stream->getSize(),
'application/vnd.microsoft.portable-executable'));
51 $this->assertSame(ProcessingStatus::DENIED, $result->getCode());
52 $this->assertSame(
'Virus detected.', $result->getMessage());
The documentation for this class was generated from the following file: