static::
assertEquals(Response::HTTP_BAD_REQUEST,
$exception->
getStatusCode());
static::
assertEquals(MediaException::MEDIA_FILE_TYPE_NOT_SUPPORTED,
$exception->
getErrorCode());
static::
assertEquals('The file extension "extension" for media object with id media-id is not supported.',
$exception->
getMessage());
static::
assertEquals(['mediaId' =>
$mediaId, 'extension' =>
$extension],
$exception->
getParameters());
} public function testCouldNotRenameFile(): void
{ $mediaId = 'media-id';
$oldFileName = 'old-file-name';
$exception = MediaException::
couldNotRenameFile($mediaId,
$oldFileName);
static::
assertEquals(Response::HTTP_CONFLICT,
$exception->
getStatusCode());
static::
assertEquals(MediaException::MEDIA_COULD_NOT_RENAME_FILE,
$exception->
getErrorCode());
static::
assertEquals('Could not rename file for media with id: media-id. Rollback to filename: "old-file-name"',
$exception->
getMessage());
static::
assertEquals(['mediaId' =>
$mediaId, 'oldFileName' =>
$oldFileName],
$exception->
getParameters());
} public function testEmptyMediaId(): void
{ $exception = MediaException::
emptyMediaId();