mirror of
https://github.com/shlinkio/shlink.git
synced 2025-02-25 18:45:27 -06:00
Changed all public setUp methods in tests to be protected
This commit is contained in:
@@ -25,7 +25,7 @@ class PixelActionTest extends TestCase
|
||||
private ObjectProphecy $urlResolver;
|
||||
private ObjectProphecy $requestTracker;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->urlResolver = $this->prophesize(ShortUrlResolverInterface::class);
|
||||
$this->requestTracker = $this->prophesize(RequestTrackerInterface::class);
|
||||
|
||||
@@ -39,7 +39,7 @@ class QrCodeActionTest extends TestCase
|
||||
private ObjectProphecy $urlResolver;
|
||||
private QrCodeOptions $options;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$router = $this->prophesize(RouterInterface::class);
|
||||
$router->generateUri(Argument::cetera())->willReturn('/foo/bar');
|
||||
|
||||
@@ -31,7 +31,7 @@ class RedirectActionTest extends TestCase
|
||||
private ObjectProphecy $requestTracker;
|
||||
private ObjectProphecy $redirectRespHelper;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->urlResolver = $this->prophesize(ShortUrlResolverInterface::class);
|
||||
$this->requestTracker = $this->prophesize(RequestTrackerInterface::class);
|
||||
|
||||
@@ -11,7 +11,7 @@ class BasePathPrefixerTest extends TestCase
|
||||
{
|
||||
private BasePathPrefixer $prefixer;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->prefixer = new BasePathPrefixer();
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ class ConfigProviderTest extends TestCase
|
||||
{
|
||||
private ConfigProvider $configProvider;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->configProvider = new ConfigProvider();
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ class DomainServiceTest extends TestCase
|
||||
private DomainService $domainService;
|
||||
private ObjectProphecy $em;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->em = $this->prophesize(EntityManagerInterface::class);
|
||||
$this->domainService = new DomainService($this->em->reveal(), 'default.com');
|
||||
|
||||
@@ -31,7 +31,7 @@ class NotFoundRedirectHandlerTest extends TestCase
|
||||
private ObjectProphecy $next;
|
||||
private ServerRequestInterface $req;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->redirectOptions = new NotFoundRedirectOptions();
|
||||
$this->resolver = $this->prophesize(NotFoundRedirectResolverInterface::class);
|
||||
|
||||
@@ -21,7 +21,7 @@ class NotFoundTemplateHandlerTest extends TestCase
|
||||
private NotFoundTemplateHandler $handler;
|
||||
private bool $readFileCalled;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->readFileCalled = false;
|
||||
$readFile = function (string $fileName): string {
|
||||
|
||||
@@ -18,7 +18,7 @@ class CloseDbConnectionEventListenerDelegatorTest extends TestCase
|
||||
private CloseDbConnectionEventListenerDelegator $delegator;
|
||||
private ObjectProphecy $container;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->container = $this->prophesize(ContainerInterface::class);
|
||||
$this->delegator = new CloseDbConnectionEventListenerDelegator();
|
||||
|
||||
@@ -20,7 +20,7 @@ class CloseDbConnectionEventListenerTest extends TestCase
|
||||
|
||||
private ObjectProphecy $em;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->em = $this->prophesize(ReopeningEntityManagerInterface::class);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ class LocateVisitTest extends TestCase
|
||||
private ObjectProphecy $dbUpdater;
|
||||
private ObjectProphecy $eventDispatcher;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->ipLocationResolver = $this->prophesize(IpLocationResolverInterface::class);
|
||||
$this->em = $this->prophesize(EntityManagerInterface::class);
|
||||
|
||||
@@ -31,7 +31,7 @@ class NotifyVisitToMercureTest extends TestCase
|
||||
private ObjectProphecy $em;
|
||||
private ObjectProphecy $logger;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->helper = $this->prophesize(PublishingHelperInterface::class);
|
||||
$this->updatesGenerator = $this->prophesize(PublishingUpdatesGeneratorInterface::class);
|
||||
|
||||
@@ -38,7 +38,7 @@ class NotifyVisitToWebHooksTest extends TestCase
|
||||
private ObjectProphecy $em;
|
||||
private ObjectProphecy $logger;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->httpClient = $this->prophesize(ClientInterface::class);
|
||||
$this->em = $this->prophesize(EntityManagerInterface::class);
|
||||
|
||||
@@ -21,7 +21,7 @@ class PublishingUpdatesGeneratorTest extends TestCase
|
||||
{
|
||||
private PublishingUpdatesGenerator $generator;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->generator = new PublishingUpdatesGenerator(
|
||||
new ShortUrlDataTransformer(new ShortUrlStringifier([])),
|
||||
|
||||
@@ -31,7 +31,7 @@ class DeleteShortUrlServiceTest extends TestCase
|
||||
private ObjectProphecy $urlResolver;
|
||||
private string $shortCode;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$shortUrl = ShortUrl::createEmpty()->setVisits(new ArrayCollection(
|
||||
map(range(0, 10), fn () => Visit::forValidShortUrl(ShortUrl::createEmpty(), Visitor::emptyInstance())),
|
||||
|
||||
@@ -32,7 +32,7 @@ class ShortUrlResolverTest extends TestCase
|
||||
private ShortUrlResolver $urlResolver;
|
||||
private ObjectProphecy $em;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->em = $this->prophesize(EntityManagerInterface::class);
|
||||
$this->urlResolver = new ShortUrlResolver($this->em->reveal());
|
||||
|
||||
@@ -34,7 +34,7 @@ class ShortUrlServiceTest extends TestCase
|
||||
private ObjectProphecy $urlResolver;
|
||||
private ObjectProphecy $titleResolutionHelper;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->em = $this->prophesize(EntityManagerInterface::class);
|
||||
$this->em->persist(Argument::any())->willReturn(null);
|
||||
|
||||
@@ -30,7 +30,7 @@ class UrlShortenerTest extends TestCase
|
||||
private ObjectProphecy $shortCodeHelper;
|
||||
private ObjectProphecy $eventDispatcher;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->titleResolutionHelper = $this->prophesize(ShortUrlTitleResolutionHelperInterface::class);
|
||||
$this->titleResolutionHelper->processTitleAndValidateUrl(Argument::cetera())->willReturnArgument();
|
||||
|
||||
@@ -22,7 +22,7 @@ class ShortUrlRepositoryAdapterTest extends TestCase
|
||||
|
||||
private ObjectProphecy $repo;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->repo = $this->prophesize(ShortUrlRepositoryInterface::class);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ class PersistenceShortUrlRelationResolverTest extends TestCase
|
||||
private PersistenceShortUrlRelationResolver $resolver;
|
||||
private ObjectProphecy $em;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->em = $this->prophesize(EntityManagerInterface::class);
|
||||
$this->em->getEventManager()->willReturn(new EventManager());
|
||||
|
||||
@@ -13,7 +13,7 @@ class SimpleShortUrlRelationResolverTest extends TestCase
|
||||
{
|
||||
private SimpleShortUrlRelationResolver $resolver;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->resolver = new SimpleShortUrlRelationResolver();
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ class ShortUrlDataTransformerTest extends TestCase
|
||||
{
|
||||
private ShortUrlDataTransformer $transformer;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->transformer = new ShortUrlDataTransformer(new ShortUrlStringifier([]));
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ class TagServiceTest extends TestCase
|
||||
private ObjectProphecy $em;
|
||||
private ObjectProphecy $repo;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->em = $this->prophesize(EntityManagerInterface::class);
|
||||
$this->repo = $this->prophesize(TagRepository::class);
|
||||
|
||||
@@ -27,7 +27,7 @@ class UrlValidatorTest extends TestCase
|
||||
private ObjectProphecy $httpClient;
|
||||
private UrlShortenerOptions $options;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->httpClient = $this->prophesize(ClientInterface::class);
|
||||
$this->options = new UrlShortenerOptions(['validate_url' => true]);
|
||||
|
||||
@@ -38,7 +38,7 @@ class VisitLocatorTest extends TestCase
|
||||
private ObjectProphecy $em;
|
||||
private ObjectProphecy $repo;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->em = $this->prophesize(EntityManager::class);
|
||||
$this->repo = $this->prophesize(VisitRepositoryInterface::class);
|
||||
|
||||
@@ -43,7 +43,7 @@ class VisitsStatsHelperTest extends TestCase
|
||||
private VisitsStatsHelper $helper;
|
||||
private ObjectProphecy $em;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->em = $this->prophesize(EntityManagerInterface::class);
|
||||
$this->helper = new VisitsStatsHelper($this->em->reveal());
|
||||
|
||||
@@ -26,7 +26,7 @@ class VisitsTrackerTest extends TestCase
|
||||
private ObjectProphecy $eventDispatcher;
|
||||
private TrackingOptions $options;
|
||||
|
||||
public function setUp(): void
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->em = $this->prophesize(EntityManager::class);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user