diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php')
-rw-r--r-- | src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php new file mode 100644 index 00000000..c73173e8 --- /dev/null +++ b/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php | |||
@@ -0,0 +1,37 @@ | |||
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 | } | ||