Load specific env file when running API tests

This commit is contained in:
Alejandro Celaya
2024-10-23 09:16:52 +02:00
parent c0200317dd
commit 46601443f5
25 changed files with 59 additions and 83 deletions

View File

@@ -31,10 +31,7 @@ class ListShortUrlsActionTest extends TestCase
$this->service = $this->createMock(ShortUrlListServiceInterface::class);
$this->action = new ListShortUrlsAction($this->service, new ShortUrlDataTransformer(
new ShortUrlStringifier(new UrlShortenerOptions(domain: [
'hostname' => 's.test',
'schema' => 'https',
])),
new ShortUrlStringifier(new UrlShortenerOptions('s.test')),
));
}

View File

@@ -25,10 +25,7 @@ class DomainVisitsActionTest extends TestCase
protected function setUp(): void
{
$this->visitsHelper = $this->createMock(VisitsStatsHelperInterface::class);
$this->action = new DomainVisitsAction(
$this->visitsHelper,
new UrlShortenerOptions(domain: ['hostname' => 'the_default.com']),
);
$this->action = new DomainVisitsAction($this->visitsHelper, new UrlShortenerOptions('the_default.com'));
}
#[Test, DataProvider('provideDomainAuthorities')]

View File

@@ -24,9 +24,7 @@ class DropDefaultDomainFromRequestMiddlewareTest extends TestCase
protected function setUp(): void
{
$this->next = $this->createMock(RequestHandlerInterface::class);
$this->middleware = new DropDefaultDomainFromRequestMiddleware(
new UrlShortenerOptions(domain: ['hostname' => 's.test']),
);
$this->middleware = new DropDefaultDomainFromRequestMiddleware(new UrlShortenerOptions('s.test'));
}
#[Test, DataProvider('provideQueryParams')]