Replaced third party domains used in tests by custom shlink domains

This commit is contained in:
Alejandro Celaya 2019-11-16 13:37:53 +01:00
parent f6bddc6f24
commit 45ac2c3c51
2 changed files with 6 additions and 5 deletions

View file

@ -84,7 +84,7 @@ class UrlValidatorTest extends TestCase
public function provideUrls(): iterable public function provideUrls(): iterable
{ {
yield 'regular domain' => ['http://foobar.com', 'http://foobar.com']; yield 'regular domain' => ['http://foobar.com', 'http://foobar.com'];
yield 'IDN' => ['https://cédric.laubacher.io/', 'https://xn--cdric-bsa.laubacher.io/']; yield 'IDN' => ['https://tést.shlink.io', 'https://xn--tst-bma.shlink.io'];
} }
/** @test */ /** @test */

View file

@ -188,16 +188,17 @@ class CreateShortUrlActionTest extends ApiTestCase
*/ */
public function createsNewShortUrlWithInternationalizedDomainName(string $longUrl): void public function createsNewShortUrlWithInternationalizedDomainName(string $longUrl): void
{ {
[$statusCode, ['longUrl' => $expectedLongUrl]] = $this->createShortUrl(['longUrl' => $longUrl]); [$statusCode, $payload] = $this->createShortUrl(['longUrl' => $longUrl]);
$this->assertEquals(self::STATUS_OK, $statusCode); $this->assertEquals(self::STATUS_OK, $statusCode);
$this->assertEquals($expectedLongUrl, $longUrl); $this->assertEquals($payload['longUrl'], $longUrl);
} }
public function provideIdn(): iterable public function provideIdn(): iterable
{ {
// TODO Create some shlink IDN domains to test this instead of using public ones yield ['http://tést.shlink.io']; // Redirects to https://shlink.io
return [['https://cédric.laubacher.io/'], ['https://laubacher.io/']]; // Second one redirects to first yield ['http://test.shlink.io']; // Redirects to http://tést.shlink.io
yield ['http://téstb.shlink.io']; // Redirects to http://tést.shlink.io
} }
/** /**