aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/ApiBundle/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Wallabag/ApiBundle/Controller')
-rw-r--r--tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
index dc5160c7..1f5c7a4f 100644
--- a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
+++ b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
@@ -714,4 +714,35 @@ class EntryRestControllerTest extends WallabagApiTestCase
714 714
715 $this->assertEquals('application/json', $this->client->getResponse()->headers->get('Content-Type')); 715 $this->assertEquals('application/json', $this->client->getResponse()->headers->get('Content-Type'));
716 } 716 }
717
718 public function testPostEntriesTagsListAction()
719 {
720 $list = [
721 [
722 'url' => 'http://0.0.0.0/entry1',
723 'tags' => 'foo bar, baz',
724 'action' => 'delete',
725 ],
726 [
727 'url' => 'http://0.0.0.0/entry2',
728 'tags' => 'new tag 1, new tag 2',
729 'action' => 'add',
730 ],
731 ];
732
733 $this->client->request('POST', '/api/entries/tags/lists?list='.json_encode($list));
734
735 $this->assertEquals(200, $this->client->getResponse()->getStatusCode());
736
737 $content = json_decode($this->client->getResponse()->getContent(), true);
738
739
740 $this->assertFalse($content[0]['entry']);
741 $this->assertEquals('http://0.0.0.0/entry1', $content[0]['url']);
742 $this->assertEquals('delete', $content[0]['action']);
743
744 $this->assertInternalType('int', $content[1]['entry']);
745 $this->assertEquals('http://0.0.0.0/entry2', $content[1]['url']);
746 $this->assertEquals('add', $content[1]['action']);
747 }
717} 748}