]> git.immae.eu Git - github/wallabag/wallabag.git/blob - src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php
Jump to unrelease predis
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / DataFixtures / SiteCredentialFixtures.php
1 <?php
2
3 namespace Wallabag\CoreBundle\DataFixtures;
4
5 use Doctrine\Bundle\FixturesBundle\Fixture;
6 use Doctrine\Common\DataFixtures\DependentFixtureInterface;
7 use Doctrine\Common\Persistence\ObjectManager;
8 use Wallabag\CoreBundle\Entity\SiteCredential;
9 use Wallabag\UserBundle\DataFixtures\UserFixtures;
10
11 class SiteCredentialFixtures extends Fixture implements DependentFixtureInterface
12 {
13 /**
14 * {@inheritdoc}
15 */
16 public function load(ObjectManager $manager)
17 {
18 $credential = new SiteCredential($this->getReference('admin-user'));
19 $credential->setHost('example.com');
20 $credential->setUsername('foo');
21 $credential->setPassword('bar');
22
23 $manager->persist($credential);
24
25 $manager->flush();
26 }
27
28 /**
29 * {@inheritdoc}
30 */
31 public function getDependencies()
32 {
33 return [
34 UserFixtures::class,
35 ];
36 }
37 }