From 45ac2c3c51f6e0d55eb2e66e49c279525270ca5a Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Sat, 16 Nov 2019 13:37:53 +0100 Subject: [PATCH] Replaced third party domains used in tests by custom shlink domains --- module/Core/test/Util/UrlValidatorTest.php | 2 +- module/Rest/test-api/Action/CreateShortUrlActionTest.php | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/module/Core/test/Util/UrlValidatorTest.php b/module/Core/test/Util/UrlValidatorTest.php index 42e1e80e..5dbfe582 100644 --- a/module/Core/test/Util/UrlValidatorTest.php +++ b/module/Core/test/Util/UrlValidatorTest.php @@ -84,7 +84,7 @@ class UrlValidatorTest extends TestCase public function provideUrls(): iterable { 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 */ diff --git a/module/Rest/test-api/Action/CreateShortUrlActionTest.php b/module/Rest/test-api/Action/CreateShortUrlActionTest.php index 51564164..61c5c7a0 100644 --- a/module/Rest/test-api/Action/CreateShortUrlActionTest.php +++ b/module/Rest/test-api/Action/CreateShortUrlActionTest.php @@ -188,16 +188,17 @@ class CreateShortUrlActionTest extends ApiTestCase */ 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($expectedLongUrl, $longUrl); + $this->assertEquals($payload['longUrl'], $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 + yield ['http://tést.shlink.io']; // Redirects to https://shlink.io + 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 } /**