mirror of
https://github.com/shlinkio/shlink.git
synced 2026-03-10 17:23:12 +08:00
Handled IDN domains also on internal redirections when validating a URL
This commit is contained in:
@@ -182,16 +182,24 @@ class CreateShortUrlActionTest extends ApiTestCase
|
||||
$this->assertNotEquals($firstShortCode, $secondShortCode);
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function createsNewShortUrlWithInternationalizedDomainName(): void
|
||||
/**
|
||||
* @test
|
||||
* @dataProvider provideIdn
|
||||
*/
|
||||
public function createsNewShortUrlWithInternationalizedDomainName(string $longUrl): void
|
||||
{
|
||||
$longUrl = 'https://cédric.laubacher.io/';
|
||||
[$statusCode, ['longUrl' => $expectedLongUrl]] = $this->createShortUrl(['longUrl' => $longUrl]);
|
||||
|
||||
$this->assertEquals(self::STATUS_OK, $statusCode);
|
||||
$this->assertEquals($expectedLongUrl, $longUrl);
|
||||
}
|
||||
|
||||
public function provideIdn(): iterable
|
||||
{
|
||||
// TODO Create some shlink IDN domains to test this instead of using public ones
|
||||
return [['https://cédric.laubacher.io/'], ['https://laubacher.io/']]; // Second one redirects to first
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array {
|
||||
* @var int $statusCode
|
||||
|
||||
Reference in New Issue
Block a user