mirror of
https://github.com/shlinkio/shlink.git
synced 2026-02-28 04:03:12 +08:00
Allowed to set redirects for default domain via command line or API
This commit is contained in:
@@ -15,7 +15,6 @@ use Shlinkio\Shlink\Core\Domain\Model\DomainItem;
|
||||
use Shlinkio\Shlink\Core\Domain\Repository\DomainRepositoryInterface;
|
||||
use Shlinkio\Shlink\Core\Entity\Domain;
|
||||
use Shlinkio\Shlink\Core\Exception\DomainNotFoundException;
|
||||
use Shlinkio\Shlink\Core\Exception\InvalidDomainException;
|
||||
use Shlinkio\Shlink\Core\Options\NotFoundRedirectOptions;
|
||||
use Shlinkio\Shlink\Rest\ApiKey\Model\ApiKeyMeta;
|
||||
use Shlinkio\Shlink\Rest\ApiKey\Model\RoleDefinition;
|
||||
@@ -42,7 +41,7 @@ class DomainServiceTest extends TestCase
|
||||
{
|
||||
$repo = $this->prophesize(DomainRepositoryInterface::class);
|
||||
$getRepo = $this->em->getRepository(Domain::class)->willReturn($repo->reveal());
|
||||
$findDomains = $repo->findDomainsWithout('default.com', $apiKey)->willReturn($domains);
|
||||
$findDomains = $repo->findDomainsWithout(null, $apiKey)->willReturn($domains);
|
||||
|
||||
$result = $this->domainService->listDomains($apiKey);
|
||||
|
||||
@@ -214,15 +213,4 @@ class DomainServiceTest extends TestCase
|
||||
yield 'domain not found and author API key' => [null, $authorApiKey];
|
||||
yield 'domain found and author API key' => [$domain, $authorApiKey];
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function anExceptionIsThrowsWhenTryingToEditRedirectsForDefaultDomain(): void
|
||||
{
|
||||
$this->expectException(InvalidDomainException::class);
|
||||
$this->expectExceptionMessage(
|
||||
'You cannot configure default domain\'s redirects this way. Use the configuration or env vars.',
|
||||
);
|
||||
|
||||
$this->domainService->configureNotFoundRedirects('default.com', NotFoundRedirects::withoutRedirects());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user