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.php29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php b/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php
index 4164e516..0ffe7fe6 100644
--- a/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php
+++ b/src/Wallabag/CoreBundle/Tests/Controller/WallabagRestControllerTest.php
@@ -150,4 +150,33 @@ 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 testGetOneTag()
155 {
156 $client = $this->createClient();
157 $client->request('GET', '/api/salts/admin.json');
158 $salt = json_decode($client->getResponse()->getContent());
159
160 $headers = $this->generateHeaders('admin', 'test', $salt[0]);
161
162 $tag = $client->getContainer()
163 ->get('doctrine.orm.entity_manager')
164 ->getRepository('WallabagCoreBundle:Tag')
165 ->findOneByLabel('foo');
166
167 if (!$tag) {
168 $this->markTestSkipped('No content found in db.');
169 }
170
171 $client->request('GET', '/api/tags/'.$tag->getLabel().'.json', array(), array(), $headers);
172
173 $this->assertEquals(json_encode($tag), $client->getResponse()->getContent());
174
175 $this->assertTrue(
176 $client->getResponse()->headers->contains(
177 'Content-Type',
178 'application/json'
179 )
180 );
181 }
153} 182}