'documents'
))->
getMessage());
$file =
$this->
getUploadFixture('empty.xls'
);
$this->
getUploadService()->
upload($file, 'test', 'documents', Context::
createDefaultContext());
} public function testUploadDocumentFailFilenameContainsPhp(): void
{ $this->
expectException(MediaException::
class);
$this->
expectExceptionMessage( MediaException::
illegalFileName('contains.php.pdf', 'contains PHP related file extension'
)->
getMessage() );
$file =
$this->
getUploadFixture('contains.php.pdf'
);
$this->
getUploadService()->
upload($file, 'test', 'documents', Context::
createDefaultContext());
} public function testUploadImage(): void
{ $file =
$this->
getUploadFixture('image.png'
);
$result =
$this->
getUploadService()->
upload($file, 'test', 'images', Context::
createDefaultContext());