aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/DataFixtures
diff options
context:
space:
mode:
authorJeremy <jeremy.benoist@gmail.com>2015-02-10 22:32:42 +0100
committerJeremy <jeremy.benoist@gmail.com>2015-02-10 22:32:42 +0100
commiteb3bd7efb73f2e8500b6415e16438cea77aa4e9a (patch)
treed42ff8fbd1138d8995e45815d9bc5260aa458e6c /src/Wallabag/CoreBundle/DataFixtures
parentf59f45d74093e92656f9717c8c5f4e37c56d2173 (diff)
downloadwallabag-eb3bd7efb73f2e8500b6415e16438cea77aa4e9a.tar.gz
wallabag-eb3bd7efb73f2e8500b6415e16438cea77aa4e9a.tar.zst
wallabag-eb3bd7efb73f2e8500b6415e16438cea77aa4e9a.zip
Add more tests on Entry controller
Also add more fixtures
Diffstat (limited to 'src/Wallabag/CoreBundle/DataFixtures')
-rw-r--r--src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php23
-rw-r--r--src/Wallabag/CoreBundle/DataFixtures/ORM/LoadUserData.php15
2 files changed, 35 insertions, 3 deletions
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php
index fccd06be..520b44b8 100644
--- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php
+++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadEntryData.php
@@ -16,13 +16,32 @@ class LoadEntryData extends AbstractFixture implements OrderedFixtureInterface
16 { 16 {
17 $entry1 = new Entry($this->getReference('admin-user')); 17 $entry1 = new Entry($this->getReference('admin-user'));
18 $entry1->setUrl('http://0.0.0.0'); 18 $entry1->setUrl('http://0.0.0.0');
19 $entry1->setTitle('test title'); 19 $entry1->setTitle('test title entry1');
20 $entry1->setContent('This is my content /o/'); 20 $entry1->setContent('This is my content /o/');
21 21
22 $manager->persist($entry1); 22 $manager->persist($entry1);
23 $manager->flush();
24 23
25 $this->addReference('entry1', $entry1); 24 $this->addReference('entry1', $entry1);
25
26 $entry2 = new Entry($this->getReference('admin-user'));
27 $entry2->setUrl('http://0.0.0.0');
28 $entry2->setTitle('test title entry2');
29 $entry2->setContent('This is my content /o/');
30
31 $manager->persist($entry2);
32
33 $this->addReference('entry2', $entry2);
34
35 $entry3 = new Entry($this->getReference('bob-user'));
36 $entry3->setUrl('http://0.0.0.0');
37 $entry3->setTitle('test title entry3');
38 $entry3->setContent('This is my content /o/');
39
40 $manager->persist($entry3);
41
42 $this->addReference('entry3', $entry3);
43
44 $manager->flush();
26 } 45 }
27 46
28 /** 47 /**
diff --git a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadUserData.php b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadUserData.php
index da788218..e4751f20 100644
--- a/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadUserData.php
+++ b/src/Wallabag/CoreBundle/DataFixtures/ORM/LoadUserData.php
@@ -15,13 +15,26 @@ class LoadUserData extends AbstractFixture implements OrderedFixtureInterface
15 public function load(ObjectManager $manager) 15 public function load(ObjectManager $manager)
16 { 16 {
17 $userAdmin = new User(); 17 $userAdmin = new User();
18 $userAdmin->setName('Big boss');
19 $userAdmin->setEmail('bigboss@wallabag.org');
18 $userAdmin->setUsername('admin'); 20 $userAdmin->setUsername('admin');
19 $userAdmin->setPassword('test'); 21 $userAdmin->setPassword('test');
20 22
21 $manager->persist($userAdmin); 23 $manager->persist($userAdmin);
22 $manager->flush();
23 24
24 $this->addReference('admin-user', $userAdmin); 25 $this->addReference('admin-user', $userAdmin);
26
27 $bobUser = new User();
28 $bobUser->setName('Bobby');
29 $bobUser->setEmail('bobby@wallabag.org');
30 $bobUser->setUsername('bob');
31 $bobUser->setPassword('test');
32
33 $manager->persist($bobUser);
34
35 $this->addReference('bob-user', $bobUser);
36
37 $manager->flush();
25 } 38 }
26 39
27 /** 40 /**