aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
diff options
context:
space:
mode:
authorKevin Decherf <kevin@kdecherf.com>2018-09-05 14:25:32 +0200
committerKevin Decherf <kevin@kdecherf.com>2018-09-05 14:25:32 +0200
commit2a1ceb67b4400f46f4d3067e887ff54aa906f0a2 (patch)
treedf0b695eb99e96dc55b63b27a404080c23421639 /tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
parent685a5d745e2b723a09111d7d31157cced67ea9b4 (diff)
downloadwallabag-2a1ceb67b4400f46f4d3067e887ff54aa906f0a2.tar.gz
wallabag-2a1ceb67b4400f46f4d3067e887ff54aa906f0a2.tar.zst
wallabag-2a1ceb67b4400f46f4d3067e887ff54aa906f0a2.zip
php-cs-fixer
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
Diffstat (limited to 'tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php')
-rw-r--r--tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php30
1 files changed, 15 insertions, 15 deletions
diff --git a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
index 9722986e..58b617f3 100644
--- a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
+++ b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
@@ -28,7 +28,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
28 28
29 $this->assertSame($entry->getTitle(), $content['title']); 29 $this->assertSame($entry->getTitle(), $content['title']);
30 $this->assertSame($entry->getUrl(), $content['url']); 30 $this->assertSame($entry->getUrl(), $content['url']);
31 $this->assertCount(count($entry->getTags()), $content['tags']); 31 $this->assertCount(\count($entry->getTags()), $content['tags']);
32 $this->assertSame($entry->getUserName(), $content['user_name']); 32 $this->assertSame($entry->getUserName(), $content['user_name']);
33 $this->assertSame($entry->getUserEmail(), $content['user_email']); 33 $this->assertSame($entry->getUserEmail(), $content['user_email']);
34 $this->assertSame($entry->getUserId(), $content['user_id']); 34 $this->assertSame($entry->getUserId(), $content['user_id']);
@@ -127,7 +127,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
127 127
128 $content = json_decode($this->client->getResponse()->getContent(), true); 128 $content = json_decode($this->client->getResponse()->getContent(), true);
129 129
130 $this->assertGreaterThanOrEqual(1, count($content)); 130 $this->assertGreaterThanOrEqual(1, \count($content));
131 $this->assertNotEmpty($content['_embedded']['items']); 131 $this->assertNotEmpty($content['_embedded']['items']);
132 $this->assertGreaterThanOrEqual(1, $content['total']); 132 $this->assertGreaterThanOrEqual(1, $content['total']);
133 $this->assertSame(1, $content['page']); 133 $this->assertSame(1, $content['page']);
@@ -154,7 +154,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
154 154
155 $content = json_decode($this->client->getResponse()->getContent(), true); 155 $content = json_decode($this->client->getResponse()->getContent(), true);
156 156
157 $this->assertGreaterThanOrEqual(1, count($content)); 157 $this->assertGreaterThanOrEqual(1, \count($content));
158 $this->assertArrayHasKey('items', $content['_embedded']); 158 $this->assertArrayHasKey('items', $content['_embedded']);
159 $this->assertGreaterThanOrEqual(0, $content['total']); 159 $this->assertGreaterThanOrEqual(0, $content['total']);
160 $this->assertSame(1, $content['page']); 160 $this->assertSame(1, $content['page']);
@@ -206,7 +206,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
206 206
207 $content = json_decode($this->client->getResponse()->getContent(), true); 207 $content = json_decode($this->client->getResponse()->getContent(), true);
208 208
209 $this->assertGreaterThanOrEqual(1, count($content)); 209 $this->assertGreaterThanOrEqual(1, \count($content));
210 $this->assertArrayHasKey('items', $content['_embedded']); 210 $this->assertArrayHasKey('items', $content['_embedded']);
211 $this->assertGreaterThanOrEqual(1, $content['total']); 211 $this->assertGreaterThanOrEqual(1, $content['total']);
212 $this->assertSame(1, $content['page']); 212 $this->assertSame(1, $content['page']);
@@ -250,7 +250,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
250 250
251 $content = json_decode($this->client->getResponse()->getContent(), true); 251 $content = json_decode($this->client->getResponse()->getContent(), true);
252 252
253 $this->assertGreaterThanOrEqual(1, count($content)); 253 $this->assertGreaterThanOrEqual(1, \count($content));
254 $this->assertNotEmpty($content['_embedded']['items']); 254 $this->assertNotEmpty($content['_embedded']['items']);
255 $this->assertGreaterThanOrEqual(1, $content['total']); 255 $this->assertGreaterThanOrEqual(1, $content['total']);
256 $this->assertSame(1, $content['page']); 256 $this->assertSame(1, $content['page']);
@@ -278,7 +278,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
278 278
279 $content = json_decode($this->client->getResponse()->getContent(), true); 279 $content = json_decode($this->client->getResponse()->getContent(), true);
280 280
281 $this->assertGreaterThanOrEqual(1, count($content)); 281 $this->assertGreaterThanOrEqual(1, \count($content));
282 $this->assertNotEmpty($content['_embedded']['items']); 282 $this->assertNotEmpty($content['_embedded']['items']);
283 $this->assertGreaterThanOrEqual(1, $content['total']); 283 $this->assertGreaterThanOrEqual(1, $content['total']);
284 $this->assertSame(1, $content['page']); 284 $this->assertSame(1, $content['page']);
@@ -305,7 +305,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
305 305
306 $content = json_decode($this->client->getResponse()->getContent(), true); 306 $content = json_decode($this->client->getResponse()->getContent(), true);
307 307
308 $this->assertGreaterThanOrEqual(1, count($content)); 308 $this->assertGreaterThanOrEqual(1, \count($content));
309 $this->assertNotEmpty($content['_embedded']['items']); 309 $this->assertNotEmpty($content['_embedded']['items']);
310 $this->assertGreaterThanOrEqual(1, $content['total']); 310 $this->assertGreaterThanOrEqual(1, $content['total']);
311 $this->assertSame(1, $content['page']); 311 $this->assertSame(1, $content['page']);
@@ -342,7 +342,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
342 342
343 $content = json_decode($this->client->getResponse()->getContent(), true); 343 $content = json_decode($this->client->getResponse()->getContent(), true);
344 344
345 $this->assertGreaterThanOrEqual(1, count($content)); 345 $this->assertGreaterThanOrEqual(1, \count($content));
346 $this->assertNotEmpty($content['_embedded']['items']); 346 $this->assertNotEmpty($content['_embedded']['items']);
347 $this->assertGreaterThanOrEqual(1, $content['total']); 347 $this->assertGreaterThanOrEqual(1, $content['total']);
348 $this->assertSame(1, $content['page']); 348 $this->assertSame(1, $content['page']);
@@ -370,7 +370,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
370 370
371 $content = json_decode($this->client->getResponse()->getContent(), true); 371 $content = json_decode($this->client->getResponse()->getContent(), true);
372 372
373 $this->assertGreaterThanOrEqual(1, count($content)); 373 $this->assertGreaterThanOrEqual(1, \count($content));
374 $this->assertEmpty($content['_embedded']['items']); 374 $this->assertEmpty($content['_embedded']['items']);
375 $this->assertSame(0, $content['total']); 375 $this->assertSame(0, $content['total']);
376 $this->assertSame(1, $content['page']); 376 $this->assertSame(1, $content['page']);
@@ -608,7 +608,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
608 $this->assertSame($entry->getId(), $content['id']); 608 $this->assertSame($entry->getId(), $content['id']);
609 $this->assertSame($entry->getUrl(), $content['url']); 609 $this->assertSame($entry->getUrl(), $content['url']);
610 $this->assertSame('New awesome title', $content['title']); 610 $this->assertSame('New awesome title', $content['title']);
611 $this->assertGreaterThanOrEqual(1, count($content['tags']), 'We force only one tag'); 611 $this->assertGreaterThanOrEqual(1, \count($content['tags']), 'We force only one tag');
612 $this->assertSame(1, $content['user_id']); 612 $this->assertSame(1, $content['user_id']);
613 $this->assertSame('de_AT', $content['language']); 613 $this->assertSame('de_AT', $content['language']);
614 $this->assertSame('http://preview.io/picture.jpg', $content['preview_picture']); 614 $this->assertSame('http://preview.io/picture.jpg', $content['preview_picture']);
@@ -647,7 +647,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
647 647
648 $this->assertSame($entry->getId(), $content['id']); 648 $this->assertSame($entry->getId(), $content['id']);
649 $this->assertSame($entry->getUrl(), $content['url']); 649 $this->assertSame($entry->getUrl(), $content['url']);
650 $this->assertGreaterThanOrEqual(1, count($content['tags']), 'We force only one tag'); 650 $this->assertGreaterThanOrEqual(1, \count($content['tags']), 'We force only one tag');
651 $this->assertEmpty($content['published_by'], 'Authors were not saved because of an array instead of a string'); 651 $this->assertEmpty($content['published_by'], 'Authors were not saved because of an array instead of a string');
652 $this->assertSame($previousContent, $content['content'], 'Ensure content has not moved'); 652 $this->assertSame($previousContent, $content['content'], 'Ensure content has not moved');
653 $this->assertSame($previousLanguage, $content['language'], 'Ensure language has not moved'); 653 $this->assertSame($previousLanguage, $content['language'], 'Ensure language has not moved');
@@ -772,7 +772,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
772 $this->markTestSkipped('No content found in db.'); 772 $this->markTestSkipped('No content found in db.');
773 } 773 }
774 774
775 $nbTags = count($entry->getTags()); 775 $nbTags = \count($entry->getTags());
776 776
777 $newTags = 'tag1,tag2,tag3'; 777 $newTags = 'tag1,tag2,tag3';
778 778
@@ -783,7 +783,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
783 $content = json_decode($this->client->getResponse()->getContent(), true); 783 $content = json_decode($this->client->getResponse()->getContent(), true);
784 784
785 $this->assertArrayHasKey('tags', $content); 785 $this->assertArrayHasKey('tags', $content);
786 $this->assertSame($nbTags + 3, count($content['tags'])); 786 $this->assertSame($nbTags + 3, \count($content['tags']));
787 787
788 $entryDB = $this->client->getContainer() 788 $entryDB = $this->client->getContainer()
789 ->get('doctrine.orm.entity_manager') 789 ->get('doctrine.orm.entity_manager')
@@ -813,7 +813,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
813 } 813 }
814 814
815 // hydrate the tags relations 815 // hydrate the tags relations
816 $nbTags = count($entry->getTags()); 816 $nbTags = \count($entry->getTags());
817 $tag = $entry->getTags()[0]; 817 $tag = $entry->getTags()[0];
818 818
819 $this->client->request('DELETE', '/api/entries/' . $entry->getId() . '/tags/' . $tag->getId() . '.json'); 819 $this->client->request('DELETE', '/api/entries/' . $entry->getId() . '/tags/' . $tag->getId() . '.json');
@@ -823,7 +823,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
823 $content = json_decode($this->client->getResponse()->getContent(), true); 823 $content = json_decode($this->client->getResponse()->getContent(), true);
824 824
825 $this->assertArrayHasKey('tags', $content); 825 $this->assertArrayHasKey('tags', $content);
826 $this->assertSame($nbTags - 1, count($content['tags'])); 826 $this->assertSame($nbTags - 1, \count($content['tags']));
827 } 827 }
828 828
829 public function testSaveIsArchivedAfterPost() 829 public function testSaveIsArchivedAfterPost()