mirror of
https://github.com/shlinkio/shlink.git
synced 2024-12-22 15:13:59 -06:00
Added new test for the case in which an invalid URL is provided
This commit is contained in:
parent
509c9fe2e8
commit
f502eb0195
@ -200,6 +200,15 @@ class CreateShortUrlActionTest extends ApiTestCase
|
||||
yield ['http://téstb.shlink.io']; // Redirects to http://tést.shlink.io
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function failsToCreateShortUrlWithInvalidOriginalUrl(): void
|
||||
{
|
||||
[$statusCode, $payload] = $this->createShortUrl(['longUrl' => 'https://this-has-to-be-invalid.com']);
|
||||
|
||||
$this->assertEquals(self::STATUS_BAD_REQUEST, $statusCode);
|
||||
$this->assertEquals('INVALID_URL', $payload['error']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array {
|
||||
* @var int $statusCode
|
||||
|
Loading…
Reference in New Issue
Block a user