5require_once(
'./libs/composer/vendor/autoload.php');
10use PHPUnit\Framework\TestCase;
31 $fileHeaderBlacklist = hex2bin(
'FFD8FF');
32 $fileHeaderStart = hex2bin(
'FFD8FB');
33 $trailer = hex2bin(
'FFD9');
38 $result = $subject->process($stream,
new Metadata(
'hello.jpg', $stream->getSize(),
'image/jpg'));
41 $this->assertSame(
'File header does not match blacklist.',
$result->getMessage());
50 $fileHeaderStart = hex2bin(
'FFD8FF');
51 $trailer = hex2bin(
'FFD9');
56 $result = $subject->process($stream,
new Metadata(
'hello.jpg', $stream->getSize(),
'image/jpg'));
59 $this->assertSame(
'File header matches blacklist.',
$result->getMessage());
An exception for terminatinating execution or to throw for unit testing.
const REJECTED
Upload got rejected by a processor.
static ofString($string)
Creates a new stream with an initial value.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...