Created component wrapping the logic to determine what's the URL to redirect to for a ShortUrl

This commit is contained in:
Alejandro Celaya
2021-07-14 16:36:03 +02:00
parent 0af6ecbd34
commit d4cad337fc
7 changed files with 103 additions and 35 deletions

View File

@@ -16,6 +16,7 @@ use Shlinkio\Shlink\Core\Entity\ShortUrl;
use Shlinkio\Shlink\Core\Model\ShortUrlIdentifier;
use Shlinkio\Shlink\Core\Options\TrackingOptions;
use Shlinkio\Shlink\Core\Service\ShortUrl\ShortUrlResolverInterface;
use Shlinkio\Shlink\Core\ShortUrl\Helper\ShortUrlRedirectionBuilderInterface;
use Shlinkio\Shlink\Core\Visit\VisitsTracker;
class PixelActionTest extends TestCase
@@ -31,9 +32,13 @@ class PixelActionTest extends TestCase
$this->urlResolver = $this->prophesize(ShortUrlResolverInterface::class);
$this->visitTracker = $this->prophesize(VisitsTracker::class);
$redirectBuilder = $this->prophesize(ShortUrlRedirectionBuilderInterface::class);
$redirectBuilder->buildShortUrlRedirect(Argument::cetera())->willReturn('http://domain.com/foo/bar');
$this->action = new PixelAction(
$this->urlResolver->reveal(),
$this->visitTracker->reveal(),
$redirectBuilder->reveal(),
new TrackingOptions(),
);
}