aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Wallabag/CoreBundle/Controller/TagControllerTest.php31
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}