2020-11-21 01:44:28 -06:00
|
|
|
<?php
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
namespace ShlinkioApiTest\Shlink\Rest\Fixtures;
|
|
|
|
|
|
|
|
use Doctrine\Common\DataFixtures\AbstractFixture;
|
|
|
|
use Doctrine\Persistence\ObjectManager;
|
2021-07-23 06:11:09 -05:00
|
|
|
use Shlinkio\Shlink\Core\Config\NotFoundRedirects;
|
2022-09-23 12:03:32 -05:00
|
|
|
use Shlinkio\Shlink\Core\Domain\Entity\Domain;
|
2020-11-21 01:44:28 -06:00
|
|
|
|
|
|
|
class DomainFixture extends AbstractFixture
|
|
|
|
{
|
|
|
|
public function load(ObjectManager $manager): void
|
|
|
|
{
|
2021-07-22 13:48:58 -05:00
|
|
|
$domain = Domain::withAuthority('example.com');
|
2021-01-10 01:40:18 -06:00
|
|
|
$manager->persist($domain);
|
|
|
|
$this->addReference('example_domain', $domain);
|
|
|
|
|
2021-07-22 13:48:58 -05:00
|
|
|
$manager->persist(Domain::withAuthority('this_domain_is_detached.com'));
|
2021-07-23 06:11:09 -05:00
|
|
|
|
|
|
|
$detachedWithRedirects = Domain::withAuthority('detached-with-redirects.com');
|
2021-08-03 07:08:36 -05:00
|
|
|
$detachedWithRedirects->configureNotFoundRedirects(NotFoundRedirects::withRedirects('foo.com', 'bar.com'));
|
2021-07-23 06:11:09 -05:00
|
|
|
$manager->persist($detachedWithRedirects);
|
|
|
|
|
2020-11-21 01:44:28 -06:00
|
|
|
$manager->flush();
|
|
|
|
}
|
|
|
|
}
|