getMessage()); self::assertEquals($expectedMessage, $e->getDetail()); self::assertEquals('Invalid URL', $e->getTitle()); self::assertEquals('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 function providePrevious(): iterable { yield 'null previous' => [null]; yield 'instance previous' => [new Exception('Previous error', 10)]; } }