Merge pull request #549 from acelaya-forks/feature/use-own-test-domains

Replaced third party domains used in tests by custom shlink domains
This commit is contained in:
Alejandro Celaya 2019-11-16 13:47:37 +01:00 committed by GitHub
commit a959b5bf02
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View file

@ -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 */

View file

@ -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
}
/**