aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php')
-rw-r--r--src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php
index 4164e516..d2390055 100644
--- a/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php
@@ -150,4 +150,30 @@ class WallabagRestControllerTest extends WallabagTestCase
150 150
151 $this->assertEquals(404, $client->getResponse()->getStatusCode()); 151 $this->assertEquals(404, $client->getResponse()->getStatusCode());
152 } 152 }
153
154 public function testGetTagsEntry()
155 {
156 $client = $this->createClient();
157 $client->request('GET', '/api/salts/admin.json');
158 $salt = json_decode($client->getResponse()->getContent());
159 $headers = $this->generateHeaders('admin', 'test', $salt[0]);
160
161 $entry = $client->getContainer()
162 ->get('doctrine.orm.entity_manager')
163 ->getRepository('WallabagCoreBundle:Entry')
164 ->findOneWithTags();
165
166 if (!$entry) {
167 $this->markTestSkipped('No content found in db.');
168 }
169
170 $tags = array();
171 foreach ($entry->getTags() as $tag) {
172 $tags[] = array('id' => $tag->getId(), 'label' => $tag->getLabel());
173 }
174
175 $client->request('GET', '/api/entries/'.$entry->getId().'/tags', array(), array(), $headers);
176
177 $this->assertEquals(json_encode($tags), $client->getResponse()->getContent());
178 }
153} 179}