getMessage()); self::assertEquals($expectedMessage, $e->getDetail()); self::assertEquals('Invalid URL', $e->getTitle()); self::assertEquals('https://shlink.io/api/error/invalid-url', $e->getType()); self::assertEquals(['url' => $url], $e->getAdditionalData()); self::assertEquals(StatusCodeInterface::STATUS_BAD_REQUEST, $e->getCode()); self::assertEquals(StatusCodeInterface::STATUS_BAD_REQUEST, $e->getStatus()); self::assertEquals($prev, $e->getPrevious()); } public static function providePrevious(): iterable { yield 'null previous' => [null]; yield 'instance previous' => [new Exception('Previous error', 10)]; } }