diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php index 338121e7..1457c807 100644 --- a/src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php +++ b/src/Wallabag/CoreBundle/Tests/Controller/TagControllerTest.php | |||
@@ -68,6 +68,38 @@ class TagControllerTest extends WallabagCoreTestCase | |||
68 | $this->assertEquals(2, count($newEntry->getTags())); | 68 | $this->assertEquals(2, count($newEntry->getTags())); |
69 | } | 69 | } |
70 | 70 | ||
71 | public function testAddMultipleTagToEntry() | ||
72 | { | ||
73 | $this->logInAs('admin'); | ||
74 | $client = $this->getClient(); | ||
75 | |||
76 | $entry = $client->getContainer() | ||
77 | ->get('doctrine.orm.entity_manager') | ||
78 | ->getRepository('WallabagCoreBundle:Entry') | ||
79 | ->findOneByUsernameAndNotArchived('admin'); | ||
80 | |||
81 | $crawler = $client->request('GET', '/view/'.$entry->getId()); | ||
82 | |||
83 | $form = $crawler->filter('form[name=tag]')->form(); | ||
84 | |||
85 | $data = array( | ||
86 | 'tag[label]' => 'foo2, bar2', | ||
87 | ); | ||
88 | |||
89 | $client->submit($form, $data); | ||
90 | $this->assertEquals(302, $client->getResponse()->getStatusCode()); | ||
91 | |||
92 | $newEntry = $client->getContainer() | ||
93 | ->get('doctrine.orm.entity_manager') | ||
94 | ->getRepository('WallabagCoreBundle:Entry') | ||
95 | ->find($entry->getId()); | ||
96 | |||
97 | $tags = $newEntry->getTags()->toArray(); | ||
98 | $this->assertGreaterThanOrEqual(2, count($tags)); | ||
99 | $this->assertNotEquals(false, array_search('foo2', $tags), 'Tag foo2 is assigned to the entry'); | ||
100 | $this->assertNotEquals(false, array_search('bar2', $tags), 'Tag bar2 is assigned to the entry'); | ||
101 | } | ||
102 | |||
71 | public function testRemoveTagFromEntry() | 103 | public function testRemoveTagFromEntry() |
72 | { | 104 | { |
73 | $this->logInAs('admin'); | 105 | $this->logInAs('admin'); |