aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2016-03-15 19:31:31 +0100
committerThomas Citharel <tcit@tcit.fr>2016-03-15 19:31:31 +0100
commitbc44aa57841386553f80d5bc5aee803345276a29 (patch)
treed14be84da82c96919f403447e0e14f62ce92b26b /src/Wallabag
parent17b3d026fd6262d48a038d90bacea44a9be339e0 (diff)
downloadwallabag-bc44aa57841386553f80d5bc5aee803345276a29.tar.gz
wallabag-bc44aa57841386553f80d5bc5aee803345276a29.tar.zst
wallabag-bc44aa57841386553f80d5bc5aee803345276a29.zip
add tests on user in API responses
Diffstat (limited to 'src/Wallabag')
-rw-r--r--src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php b/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php
index cce39d0b..c264180c 100644
--- a/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php
+++ b/src/Wallabag/ApiBundle/Tests/Controller/WallabagRestControllerTest.php
@@ -27,6 +27,9 @@ class WallabagRestControllerTest extends WallabagApiTestCase
27 $this->assertEquals($entry->getTitle(), $content['title']); 27 $this->assertEquals($entry->getTitle(), $content['title']);
28 $this->assertEquals($entry->getUrl(), $content['url']); 28 $this->assertEquals($entry->getUrl(), $content['url']);
29 $this->assertCount(count($entry->getTags()), $content['tags']); 29 $this->assertCount(count($entry->getTags()), $content['tags']);
30 $this->assertEquals($entry->getUserName(), $content['user_name']);
31 $this->assertEquals($entry->getUserEmail(), $content['user_email']);
32 $this->assertEquals($entry->getUserId(), $content['user_id']);
30 33
31 $this->assertTrue( 34 $this->assertTrue(
32 $this->client->getResponse()->headers->contains( 35 $this->client->getResponse()->headers->contains(
@@ -159,6 +162,7 @@ class WallabagRestControllerTest extends WallabagApiTestCase
159 $this->assertEquals('http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', $content['url']); 162 $this->assertEquals('http://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html', $content['url']);
160 $this->assertEquals(false, $content['is_archived']); 163 $this->assertEquals(false, $content['is_archived']);
161 $this->assertEquals(false, $content['is_starred']); 164 $this->assertEquals(false, $content['is_starred']);
165 $this->assertEquals(1, $content['user_id']);
162 $this->assertCount(1, $content['tags']); 166 $this->assertCount(1, $content['tags']);
163 } 167 }
164 168
@@ -178,6 +182,7 @@ class WallabagRestControllerTest extends WallabagApiTestCase
178 $this->assertEquals('http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', $content['url']); 182 $this->assertEquals('http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', $content['url']);
179 $this->assertEquals(true, $content['is_archived']); 183 $this->assertEquals(true, $content['is_archived']);
180 $this->assertEquals(true, $content['is_starred']); 184 $this->assertEquals(true, $content['is_starred']);
185 $this->assertEquals(1, $content['user_id']);
181 } 186 }
182 187
183 public function testPatchEntry() 188 public function testPatchEntry()
@@ -209,6 +214,7 @@ class WallabagRestControllerTest extends WallabagApiTestCase
209 $this->assertEquals($entry->getUrl(), $content['url']); 214 $this->assertEquals($entry->getUrl(), $content['url']);
210 $this->assertEquals('New awesome title', $content['title']); 215 $this->assertEquals('New awesome title', $content['title']);
211 $this->assertGreaterThan($nbTags, count($content['tags'])); 216 $this->assertGreaterThan($nbTags, count($content['tags']));
217 $this->assertEquals(1, $content['user_id']);
212 } 218 }
213 219
214 public function testGetTagsEntry() 220 public function testGetTagsEntry()