diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-04-30 15:03:22 +0200 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-08-23 07:26:18 +0200 |
commit | 267e8d6361f8e7791a8687f2370a3e9d08af6648 (patch) | |
tree | 33ba4fb5e781271542bc9f7430be4d1240179f68 /tests/Wallabag | |
parent | 371bcca0f6b18951a15e56daae5bca2558c01851 (diff) | |
download | wallabag-267e8d6361f8e7791a8687f2370a3e9d08af6648.tar.gz wallabag-267e8d6361f8e7791a8687f2370a3e9d08af6648.tar.zst wallabag-267e8d6361f8e7791a8687f2370a3e9d08af6648.zip |
Add tests for tag list routes
Diffstat (limited to 'tests/Wallabag')
-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 | } |