mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Added e2e tests covering shortening of twitter URLs with url validatio enabled
This commit is contained in:
@@ -297,6 +297,24 @@ class CreateShortUrlTest extends ApiTestCase
|
|||||||
yield 'example domain' => ['example.com'];
|
yield 'example domain' => ['example.com'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @test
|
||||||
|
* @dataProvider provideTwitterUrls
|
||||||
|
*/
|
||||||
|
public function urlsWithBothProtectionCanBeShortenedWithUrlValidationEnabled(string $longUrl): void
|
||||||
|
{
|
||||||
|
[$statusCode] = $this->createShortUrl(['longUrl' => $longUrl, 'validateUrl' => true]);
|
||||||
|
self::assertEquals(self::STATUS_OK, $statusCode);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function provideTwitterUrls(): iterable
|
||||||
|
{
|
||||||
|
yield ['https://twitter.com/shlinkio'];
|
||||||
|
yield ['https://mobile.twitter.com/shlinkio'];
|
||||||
|
yield ['https://twitter.com/shlinkio/status/1360637738421268481'];
|
||||||
|
yield ['https://mobile.twitter.com/shlinkio/status/1360637738421268481'];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return array {
|
* @return array {
|
||||||
* @var int $statusCode
|
* @var int $statusCode
|
||||||
|
|||||||
Reference in New Issue
Block a user