mirror of
https://github.com/shlinkio/shlink.git
synced 2026-02-28 04:03:12 +08:00
Covered detached domains with redirects in domains list API test
This commit is contained in:
@@ -32,6 +32,10 @@ class ListDomainsTest extends ApiTestCase
|
||||
'domain' => 'doma.in',
|
||||
'isDefault' => true,
|
||||
],
|
||||
[
|
||||
'domain' => 'detached-with-redirects.com',
|
||||
'isDefault' => false,
|
||||
],
|
||||
[
|
||||
'domain' => 'example.com',
|
||||
'isDefault' => false,
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace ShlinkioApiTest\Shlink\Rest\Fixtures;
|
||||
|
||||
use Doctrine\Common\DataFixtures\AbstractFixture;
|
||||
use Doctrine\Persistence\ObjectManager;
|
||||
use Shlinkio\Shlink\Core\Config\NotFoundRedirects;
|
||||
use Shlinkio\Shlink\Core\Entity\Domain;
|
||||
|
||||
class DomainFixture extends AbstractFixture
|
||||
@@ -17,6 +18,11 @@ class DomainFixture extends AbstractFixture
|
||||
$this->addReference('example_domain', $domain);
|
||||
|
||||
$manager->persist(Domain::withAuthority('this_domain_is_detached.com'));
|
||||
|
||||
$detachedWithRedirects = Domain::withAuthority('detached-with-redirects.com');
|
||||
$detachedWithRedirects->configureNotFoundRedirects(new NotFoundRedirects('foo.com', 'bar.com'));
|
||||
$manager->persist($detachedWithRedirects);
|
||||
|
||||
$manager->flush();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user