Used league/uri to validate URLs including deeplinks, and fixed tests

This commit is contained in:
Alejandro Celaya
2020-06-27 11:09:56 +02:00
parent 08950f6433
commit 78b838f6b6
7 changed files with 13 additions and 17 deletions

View File

@@ -9,7 +9,6 @@ use PHPUnit\Framework\Assert;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\Prophecy\ObjectProphecy;
use Psr\Http\Message\UriInterface;
use Shlinkio\Shlink\Core\Entity\ShortUrl;
use Shlinkio\Shlink\Core\Exception\ValidationException;
use Shlinkio\Shlink\Core\Model\ShortUrlMeta;
@@ -71,8 +70,8 @@ class SingleStepCreateShortUrlActionTest extends TestCase
]);
$findApiKey = $this->apiKeyService->check('abc123')->willReturn(true);
$generateShortCode = $this->urlShortener->urlToShortCode(
Argument::that(function (UriInterface $argument) {
Assert::assertEquals('http://foobar.com', (string) $argument);
Argument::that(function (string $argument): string {
Assert::assertEquals('http://foobar.com', $argument);
return $argument;
}),
[],