aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2019-05-15 14:38:07 +0200
committerJeremy Benoist <jeremy.benoist@gmail.com>2019-05-15 14:38:07 +0200
commit9f0957b831622ee577fa7d8f92ec0df6f3a8e274 (patch)
tree362e95af5fc0786e7934e0ab25764d90123bf997 /src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php
parent9e2194e9cb55acf0a715e36c33f9f9d8689e0761 (diff)
parent227a1a27f19604d64ffdfee56b4c8fc6b325bee6 (diff)
downloadwallabag-9f0957b831622ee577fa7d8f92ec0df6f3a8e274.tar.gz
wallabag-9f0957b831622ee577fa7d8f92ec0df6f3a8e274.tar.zst
wallabag-9f0957b831622ee577fa7d8f92ec0df6f3a8e274.zip
Merge remote-tracking branch 'origin/master' into 2.4
Diffstat (limited to 'src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php')
-rw-r--r--src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php27
1 files changed, 23 insertions, 4 deletions
diff --git a/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php
index c73173e8..9a7d116f 100644
--- a/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php
+++ b/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php
@@ -5,20 +5,39 @@ namespace Wallabag\CoreBundle\DataFixtures;
5use Doctrine\Bundle\FixturesBundle\Fixture; 5use Doctrine\Bundle\FixturesBundle\Fixture;
6use Doctrine\Common\DataFixtures\DependentFixtureInterface; 6use Doctrine\Common\DataFixtures\DependentFixtureInterface;
7use Doctrine\Common\Persistence\ObjectManager; 7use Doctrine\Common\Persistence\ObjectManager;
8use Symfony\Component\DependencyInjection\ContainerAwareInterface;
9use Symfony\Component\DependencyInjection\ContainerInterface;
8use Wallabag\CoreBundle\Entity\SiteCredential; 10use Wallabag\CoreBundle\Entity\SiteCredential;
9use Wallabag\UserBundle\DataFixtures\UserFixtures; 11use Wallabag\UserBundle\DataFixtures\UserFixtures;
10 12
11class SiteCredentialFixtures extends Fixture implements DependentFixtureInterface 13class SiteCredentialFixtures extends Fixture implements DependentFixtureInterface, ContainerAwareInterface
12{ 14{
13 /** 15 /**
16 * @var ContainerInterface
17 */
18 private $container;
19
20 public function setContainer(ContainerInterface $container = null)
21 {
22 $this->container = $container;
23 }
24
25 /**
14 * {@inheritdoc} 26 * {@inheritdoc}
15 */ 27 */
16 public function load(ObjectManager $manager) 28 public function load(ObjectManager $manager)
17 { 29 {
18 $credential = new SiteCredential($this->getReference('admin-user')); 30 $credential = new SiteCredential($this->getReference('admin-user'));
19 $credential->setHost('example.com'); 31 $credential->setHost('.super.com');
20 $credential->setUsername('foo'); 32 $credential->setUsername($this->container->get('wallabag_core.helper.crypto_proxy')->crypt('.super'));
21 $credential->setPassword('bar'); 33 $credential->setPassword($this->container->get('wallabag_core.helper.crypto_proxy')->crypt('bar'));
34
35 $manager->persist($credential);
36
37 $credential = new SiteCredential($this->getReference('admin-user'));
38 $credential->setHost('paywall.example.com');
39 $credential->setUsername($this->container->get('wallabag_core.helper.crypto_proxy')->crypt('paywall.example'));
40 $credential->setPassword($this->container->get('wallabag_core.helper.crypto_proxy')->crypt('bar'));
22 41
23 $manager->persist($credential); 42 $manager->persist($credential);
24 43