public function testUnsupportedMediaType(): void
{ $exception = ApiException::
unsupportedMediaType('jpeg'
);
static::
assertInstanceOf(UnsupportedMediaTypeHttpException::
class,
$exception);
static::
assertSame('The Content-Type "jpeg" is unsupported.',
$exception->
getMessage());
} public function testNotExistingRelation(): void
{ $exception = ApiException::
notExistingRelation('demo'
);
static::
assertEquals(ApiException::API_NOT_EXISTING_RELATION_EXCEPTION,
$exception->
getErrorCode());
static::
assertEquals('Resource at path "demo" is not an existing relation.',
$exception->
getMessage());
} public function testBadRequest(): void
{ $exception = ApiException::
badRequest('Bad request'
);
static::
assertInstanceOf(BadRequestHttpException::
class,
$exception);
static::
assertEquals('Bad request',
$exception->
getMessage());
}