mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-14 04:00:57 +03:00
Added test to ensure default domain is ignored if provided when creatin a short URL
This commit is contained in:
parent
ccec6e03aa
commit
faec758fba
1 changed files with 16 additions and 0 deletions
|
@ -228,6 +228,22 @@ class CreateShortUrlActionTest extends ApiTestCase
|
|||
$this->assertEquals($url, $payload['url']);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function defaultDomainIsDroppedIfProvided(): void
|
||||
{
|
||||
[$createStatusCode, ['shortCode' => $shortCode]] = $this->createShortUrl([
|
||||
'longUrl' => 'https://www.alejandrocelaya.com',
|
||||
'domain' => 'doma.in',
|
||||
]);
|
||||
$getResp = $this->callApiWithKey(self::METHOD_GET, '/short-urls/' . $shortCode);
|
||||
$payload = $this->getJsonResponsePayload($getResp);
|
||||
|
||||
$this->assertEquals(self::STATUS_OK, $createStatusCode);
|
||||
$this->assertEquals(self::STATUS_OK, $getResp->getStatusCode());
|
||||
$this->assertArrayHasKey('domain', $payload);
|
||||
$this->assertNull($payload['domain']);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array {
|
||||
* @var int $statusCode
|
||||
|
|
Loading…
Add table
Reference in a new issue