diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-08-23 11:51:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-23 11:51:13 +0200 |
commit | 1bee9e0760c89756ebab0b67f9ab7efc5c6a709b (patch) | |
tree | cd6200f084675195aaa5789a3d0e1297eca1a94a /tests/Wallabag/CoreBundle | |
parent | 79efca1e6ff28362d4bd2713f68205294cdd07de (diff) | |
parent | 97e7ad4dc7bfc26cea334bc880a39e388d6848f3 (diff) | |
download | wallabag-1bee9e0760c89756ebab0b67f9ab7efc5c6a709b.tar.gz wallabag-1bee9e0760c89756ebab0b67f9ab7efc5c6a709b.tar.zst wallabag-1bee9e0760c89756ebab0b67f9ab7efc5c6a709b.zip |
Merge pull request #2218 from wallabag/api-delete-tags-1982
Delete tag or tags by label
Diffstat (limited to 'tests/Wallabag/CoreBundle')
-rw-r--r-- | tests/Wallabag/CoreBundle/Controller/TagControllerTest.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php b/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php index 58450e5f..71652760 100644 --- a/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/TagControllerTest.php | |||
@@ -131,4 +131,35 @@ class TagControllerTest extends WallabagCoreTestCase | |||
131 | 131 | ||
132 | $this->assertEquals(404, $client->getResponse()->getStatusCode()); | 132 | $this->assertEquals(404, $client->getResponse()->getStatusCode()); |
133 | } | 133 | } |
134 | |||
135 | public function testShowEntriesForTagAction() | ||
136 | { | ||
137 | $this->logInAs('admin'); | ||
138 | $client = $this->getClient(); | ||
139 | |||
140 | $entry = $client->getContainer() | ||
141 | ->get('doctrine.orm.entity_manager') | ||
142 | ->getRepository('WallabagCoreBundle:Entry') | ||
143 | ->findOneByUsernameAndNotArchived('admin'); | ||
144 | |||
145 | $tag = $client->getContainer() | ||
146 | ->get('doctrine.orm.entity_manager') | ||
147 | ->getRepository('WallabagCoreBundle:Tag') | ||
148 | ->findOneByEntryAndTagLabel($entry, 'foo'); | ||
149 | |||
150 | $crawler = $client->request('GET', '/tag/list/'.$tag->getSlug()); | ||
151 | |||
152 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | ||
153 | $this->assertCount(2, $crawler->filter('div[class=entry]')); | ||
154 | |||
155 | $tag = $client->getContainer() | ||
156 | ->get('doctrine.orm.entity_manager') | ||
157 | ->getRepository('WallabagCoreBundle:Tag') | ||
158 | ->findOneByLabel('baz'); | ||
159 | |||
160 | $crawler = $client->request('GET', '/tag/list/'.$tag->getSlug()); | ||
161 | |||
162 | $this->assertEquals(200, $client->getResponse()->getStatusCode()); | ||
163 | $this->assertCount(0, $crawler->filter('div[class=entry]')); | ||
164 | } | ||
134 | } | 165 | } |