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

@@ -8,7 +8,6 @@ use PHPUnit\Framework\Assert;
use PHPUnit\Framework\TestCase;
use Prophecy\Argument;
use Prophecy\Prophecy\ObjectProphecy;
use Psr\Http\Message\UriInterface;
use Shlinkio\Shlink\CLI\Command\ShortUrl\GenerateShortUrlCommand;
use Shlinkio\Shlink\CLI\Util\ExitCodes;
use Shlinkio\Shlink\Core\Entity\ShortUrl;
@@ -88,7 +87,7 @@ class GenerateShortUrlCommandTest extends TestCase
{
$shortUrl = new ShortUrl('');
$urlToShortCode = $this->urlShortener->urlToShortCode(
Argument::type(UriInterface::class),
Argument::type('string'),
Argument::that(function (array $tags) {
Assert::assertEquals(['foo', 'bar', 'baz', 'boo', 'zar'], $tags);
return $tags;