mirror of
https://github.com/shlinkio/shlink.git
synced 2026-02-28 04:03:12 +08:00
Load specific env file when running API tests
This commit is contained in:
@@ -40,7 +40,7 @@ readonly class RoleResolver implements RoleResolverInterface
|
||||
|
||||
private function resolveRoleForAuthority(string $domainAuthority): RoleDefinition
|
||||
{
|
||||
if ($domainAuthority === $this->urlShortenerOptions->defaultDomain()) {
|
||||
if ($domainAuthority === $this->urlShortenerOptions->defaultDomain) {
|
||||
throw InvalidRoleConfigException::forDomainOnlyWithDefaultDomain();
|
||||
}
|
||||
|
||||
|
||||
@@ -25,10 +25,7 @@ class RoleResolverTest extends TestCase
|
||||
protected function setUp(): void
|
||||
{
|
||||
$this->domainService = $this->createMock(DomainServiceInterface::class);
|
||||
$this->resolver = new RoleResolver(
|
||||
$this->domainService,
|
||||
new UrlShortenerOptions(domain: ['hostname' => 'default.com']),
|
||||
);
|
||||
$this->resolver = new RoleResolver($this->domainService, new UrlShortenerOptions('default.com'));
|
||||
}
|
||||
|
||||
#[Test, DataProvider('provideRoles')]
|
||||
|
||||
@@ -37,10 +37,7 @@ class CreateShortUrlCommandTest extends TestCase
|
||||
$command = new CreateShortUrlCommand(
|
||||
$this->urlShortener,
|
||||
$this->stringifier,
|
||||
new UrlShortenerOptions(
|
||||
domain: ['hostname' => 'example.com', 'schema' => ''],
|
||||
defaultShortCodesLength: 5,
|
||||
),
|
||||
new UrlShortenerOptions(defaultDomain: 'example.com', defaultShortCodesLength: 5),
|
||||
);
|
||||
$this->commandTester = CliTestUtils::testerForCommand($command);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user