mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-11 17:44:44 +08:00
Converted InvalidUrlException into a problem details exception
This commit is contained in:
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace ShlinkioTest\Shlink\Core\Exception;
|
||||
|
||||
use Exception;
|
||||
use Fig\Http\Message\StatusCodeInterface;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use Shlinkio\Shlink\Core\Exception\InvalidUrlException;
|
||||
use Throwable;
|
||||
@@ -19,8 +20,8 @@ class InvalidUrlExceptionTest extends TestCase
|
||||
{
|
||||
$e = InvalidUrlException::fromUrl('http://the_url.com', $prev);
|
||||
|
||||
$this->assertEquals('Provided URL "http://the_url.com" is not an existing and valid URL', $e->getMessage());
|
||||
$this->assertEquals($prev !== null ? $prev->getCode() : -1, $e->getCode());
|
||||
$this->assertEquals('Provided URL http://the_url.com is invalid. Try with a different one.', $e->getMessage());
|
||||
$this->assertEquals(StatusCodeInterface::STATUS_BAD_REQUEST, $e->getCode());
|
||||
$this->assertEquals($prev, $e->getPrevious());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user