21use PHPUnit\Framework\Attributes\BackupGlobals;
22use PHPUnit\Framework\Attributes\BackupStaticProperties;
23use PHPUnit\Framework\Attributes\PreserveGlobalState;
24use PHPUnit\Framework\Attributes\RunTestsInSeparateProcesses;
25use PHPUnit\Framework\Attributes\Test;
26use PHPUnit\Framework\Attributes\Small;
28require_once(
'./vendor/composer/vendor/autoload.php');
33use PHPUnit\Framework\TestCase;
40#[BackupGlobals(false)]
41#[BackupStaticProperties(false)]
42#[PreserveGlobalState(false)]
43#[RunTestsInSeparateProcesses]
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 complies with whitelist.', $result->getMessage());
66 $fileHeaderWhitelist = hex2bin(
'FFD8FF');
67 $fileHeaderStart = hex2bin(
'FFD8FB');
68 $trailer = hex2bin(
'FFD9');
73 $result = $subject->process($stream,
new Metadata(
'hello.jpg', $stream->getSize(),
'image/jpg'));
76 $this->assertSame(
'File header don\'t complies with whitelist.', $result->getMessage());
Stream factory which enables the user to create streams without the knowledge of the concrete class.
static ofString(string $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...