'image/webp',
'images'
))->
getMessage());
$file =
$this->
getUploadFixture('image.webp'
);
$this->
getUploadService()->
upload($file, 'test', 'images', Context::
createDefaultContext());
} public function testUploadUnknownType(): void
{ $this->
expectException(MediaValidatorMissingException::
class);
$this->
expectExceptionMessage((new MediaValidatorMissingException('notExistingType'
))->
getMessage());
$file =
$this->
getUploadFixture('image.png'
);
$this->
getUploadService()->
upload($file, 'test', 'notExistingType', Context::
createDefaultContext());
} private function getUploadFixture(string
$filename): UploadedFile
{ return new UploadedFile(self::FIXTURE_DIR . '/' .
$filename,
$filename, null, null, true
);
} private function getUploadService(): StorefrontMediaUploader
{