5require_once(
'./libs/composer/vendor/autoload.php');
11use PHPUnit\Framework\TestCase;
25 use Mockery\Adapter\Phpunit\MockeryPHPUnitIntegration;
31 $mock = Mockery::mock(\ilVirusScanner::class);
33 $mock->shouldReceive(
"scanFile")->once()->withArgs(array(
$stream->getMetadata(
'uri') ))->andReturn(
"Virus found!!!");
38 $this->assertSame(
'Virus detected.',
$result->getMessage());
45 $mock = Mockery::mock(\ilVirusScanner::class);
47 $mock->shouldReceive(
"scanFile")->once()->withArgs(array(
$stream->getMetadata(
'uri') ))->andReturn(
"");
An exception for terminatinating execution or to throw for unit testing.
const REJECTED
Upload got rejected by a processor.
Class VirusScannerPreProcessorTest.
Class VirusScannerPreProcessor.
static ofString($string)
Creates a new stream with an initial value.
$stream
PHP stream implementation.