static::
assertEquals(Response::HTTP_BAD_REQUEST,
$exception->
getStatusCode());
static::
assertEquals(MediaException::MEDIA_EMPTY_FILE_NAME,
$exception->
getErrorCode());
static::
assertEquals('A valid filename must be provided.',
$exception->
getMessage());
} public function testDuplicatedMediaFileName(): void
{ $fileName = 'file-name';
$fileExtension = 'file-extension';
$exception = MediaException::
duplicatedMediaFileName($fileName,
$fileExtension);
static::
assertEquals(Response::HTTP_CONFLICT,
$exception->
getStatusCode());
static::
assertEquals(MediaException::MEDIA_DUPLICATED_FILE_NAME,
$exception->
getErrorCode());
static::
assertEquals('A file with the name "file-name.file-extension" already exists.',
$exception->
getMessage());
static::
assertEquals(['fileName' =>
$fileName, 'fileExtension' =>
$fileExtension],
$exception->
getParameters());
} public function testMissingFile(): void
{ $mediaId = 'media-id';