diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2015-10-03 06:29:55 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2015-10-03 13:31:48 +0200 |
commit | 0a878469d4038c36c84d1dd707265d880fa342e8 (patch) | |
tree | 2e183d359d3f1f0767ebf56277f3fc7aa415ac3f /src/Wallabag/CoreBundle | |
parent | 1210dae10589515d6f3824c75639342c5e1d52dd (diff) | |
download | wallabag-0a878469d4038c36c84d1dd707265d880fa342e8.tar.gz wallabag-0a878469d4038c36c84d1dd707265d880fa342e8.tar.zst wallabag-0a878469d4038c36c84d1dd707265d880fa342e8.zip |
move some files to UserBundle
Diffstat (limited to 'src/Wallabag/CoreBundle')
6 files changed, 5 insertions, 55 deletions
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadUserData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadUserData.php deleted file mode 100644 index d48855da..00000000 --- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadUserData.php +++ /dev/null | |||
@@ -1,50 +0,0 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\UserBundle\DataFixtures\ORM; | ||
4 | |||
5 | use Doctrine\Common\DataFixtures\AbstractFixture; | ||
6 | use Doctrine\Common\DataFixtures\OrderedFixtureInterface; | ||
7 | use Doctrine\Common\Persistence\ObjectManager; | ||
8 | use Wallabag\UserBundle\Entity\User; | ||
9 | |||
10 | class LoadUserData extends AbstractFixture implements OrderedFixtureInterface | ||
11 | { | ||
12 | /** | ||
13 | * {@inheritdoc} | ||
14 | */ | ||
15 | public function load(ObjectManager $manager) | ||
16 | { | ||
17 | $userAdmin = new User(); | ||
18 | $userAdmin->setName('Big boss'); | ||
19 | $userAdmin->setEmail('bigboss@wallabag.org'); | ||
20 | $userAdmin->setUsername('admin'); | ||
21 | $userAdmin->setPlainPassword('mypassword'); | ||
22 | $userAdmin->setEnabled(true); | ||
23 | $userAdmin->addRole('ROLE_SUPER_ADMIN'); | ||
24 | |||
25 | $manager->persist($userAdmin); | ||
26 | |||
27 | $this->addReference('admin-user', $userAdmin); | ||
28 | |||
29 | $bobUser = new User(); | ||
30 | $bobUser->setName('Bobby'); | ||
31 | $bobUser->setEmail('bobby@wallabag.org'); | ||
32 | $bobUser->setUsername('bob'); | ||
33 | $bobUser->setPlainPassword('mypassword'); | ||
34 | $bobUser->setEnabled(true); | ||
35 | |||
36 | $manager->persist($bobUser); | ||
37 | |||
38 | $this->addReference('bob-user', $bobUser); | ||
39 | |||
40 | $manager->flush(); | ||
41 | } | ||
42 | |||
43 | /** | ||
44 | * {@inheritdoc} | ||
45 | */ | ||
46 | public function getOrder() | ||
47 | { | ||
48 | return 10; | ||
49 | } | ||
50 | } | ||
diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php index ddd4f7d9..2390bfe1 100644 --- a/src/Wallabag/CoreBundle/Entity/Config.php +++ b/src/Wallabag/CoreBundle/Entity/Config.php | |||
@@ -79,7 +79,7 @@ class Config | |||
79 | /* | 79 | /* |
80 | * @param User $user | 80 | * @param User $user |
81 | */ | 81 | */ |
82 | public function __construct(Wallabag\UserBundle\Entity\User $user) | 82 | public function __construct(\Wallabag\UserBundle\Entity\User $user) |
83 | { | 83 | { |
84 | $this->user = $user; | 84 | $this->user = $user; |
85 | } | 85 | } |
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index f6206a09..4fd74001 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php | |||
@@ -143,7 +143,7 @@ class Entry | |||
143 | /* | 143 | /* |
144 | * @param User $user | 144 | * @param User $user |
145 | */ | 145 | */ |
146 | public function __construct(Wallabag\UserBundle\Entity\User $user) | 146 | public function __construct(\Wallabag\UserBundle\Entity\User $user) |
147 | { | 147 | { |
148 | $this->user = $user; | 148 | $this->user = $user; |
149 | $this->tags = new ArrayCollection(); | 149 | $this->tags = new ArrayCollection(); |
diff --git a/src/Wallabag/CoreBundle/Entity/Tag.php b/src/Wallabag/CoreBundle/Entity/Tag.php index 6067360f..5b571823 100644 --- a/src/Wallabag/CoreBundle/Entity/Tag.php +++ b/src/Wallabag/CoreBundle/Entity/Tag.php | |||
@@ -46,7 +46,7 @@ class Tag | |||
46 | */ | 46 | */ |
47 | private $user; | 47 | private $user; |
48 | 48 | ||
49 | public function __construct(User $user) | 49 | public function __construct(\Wallabag\UserBundle\Entity\User $user) |
50 | { | 50 | { |
51 | $this->user = $user; | 51 | $this->user = $user; |
52 | $this->entries = new ArrayCollection(); | 52 | $this->entries = new ArrayCollection(); |
diff --git a/src/Wallabag/CoreBundle/Tests/EventListener/RegistrationConfirmedListenerTest.php b/src/Wallabag/CoreBundle/Tests/EventListener/RegistrationConfirmedListenerTest.php index 137c097c..df94fad2 100644 --- a/src/Wallabag/CoreBundle/Tests/EventListener/RegistrationConfirmedListenerTest.php +++ b/src/Wallabag/CoreBundle/Tests/EventListener/RegistrationConfirmedListenerTest.php | |||
@@ -9,8 +9,8 @@ use Symfony\Component\HttpFoundation\Response; | |||
9 | use FOS\UserBundle\FOSUserEvents; | 9 | use FOS\UserBundle\FOSUserEvents; |
10 | use FOS\UserBundle\Event\FilterUserResponseEvent; | 10 | use FOS\UserBundle\Event\FilterUserResponseEvent; |
11 | use Wallabag\CoreBundle\EventListener\RegistrationConfirmedListener; | 11 | use Wallabag\CoreBundle\EventListener\RegistrationConfirmedListener; |
12 | use Wallabag\CoreBundle\Entity\User; | ||
13 | use Wallabag\CoreBundle\Entity\Config; | 12 | use Wallabag\CoreBundle\Entity\Config; |
13 | use Wallabag\UserBundle\Entity\User; | ||
14 | 14 | ||
15 | class RegistrationConfirmedListenerTest extends KernelTestCase | 15 | class RegistrationConfirmedListenerTest extends KernelTestCase |
16 | { | 16 | { |
diff --git a/src/Wallabag/CoreBundle/Tests/WallabagCoreTestCase.php b/src/Wallabag/CoreBundle/Tests/WallabagCoreTestCase.php index 756525a9..e5096528 100644 --- a/src/Wallabag/CoreBundle/Tests/WallabagCoreTestCase.php +++ b/src/Wallabag/CoreBundle/Tests/WallabagCoreTestCase.php | |||
@@ -21,7 +21,7 @@ abstract class WallabagCoreTestCase extends WebTestCase | |||
21 | public function logInAs($username) | 21 | public function logInAs($username) |
22 | { | 22 | { |
23 | $crawler = $this->client->request('GET', '/login'); | 23 | $crawler = $this->client->request('GET', '/login'); |
24 | $form = $crawler->filter('input[type=submit]')->form(); | 24 | $form = $crawler->filter('button[type=submit]')->form(); |
25 | $data = array( | 25 | $data = array( |
26 | '_username' => $username, | 26 | '_username' => $username, |
27 | '_password' => 'mypassword', | 27 | '_password' => 'mypassword', |