$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();
static::
assertEquals(Response::HTTP_BAD_REQUEST,
$exception->
getStatusCode());
static::
assertEquals(MediaException::MEDIA_EMPTY_ID,
$exception->
getErrorCode());
static::
assertEquals('A media id must be provided.',
$exception->
getMessage());
} public function testInvalidBatchSize(): void
{ $exception = MediaException::
invalidBatchSize();
static::
assertEquals(Response::HTTP_BAD_REQUEST,
$exception->
getStatusCode());