Covered detached domains with redirects in domains list API test

This commit is contained in:
Alejandro Celaya 2021-07-23 13:11:09 +02:00
parent 8f3c740b57
commit 8b75ad1e7f
2 changed files with 10 additions and 0 deletions

View File

@ -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,

View File

@ -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();
}
}