aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2017-04-29 12:24:27 +0200
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2017-05-01 09:26:12 +0200
commit719ba257d3d6495eaa0f4ea749b5aa4740f94dda (patch)
treec09ec7d1034ca7b53dfc95f381de4255b38335e9
parenta7abcc7b7a5e3417eff70e2a5993558f83fc5d5a (diff)
downloadwallabag-719ba257d3d6495eaa0f4ea749b5aa4740f94dda.tar.gz
wallabag-719ba257d3d6495eaa0f4ea749b5aa4740f94dda.tar.zst
wallabag-719ba257d3d6495eaa0f4ea749b5aa4740f94dda.zip
Fix tests
-rw-r--r--src/Wallabag/ApiBundle/Controller/EntryRestController.php1
-rw-r--r--tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php8
2 files changed, 4 insertions, 5 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php
index 0c98c242..ae6f0e3f 100644
--- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php
@@ -239,7 +239,6 @@ class EntryRestController extends WallabagRestController
239 239
240 // handle multiple urls 240 // handle multiple urls
241 if (!empty($urls)) { 241 if (!empty($urls)) {
242 $results = [];
243 foreach ($urls as $key => $url) { 242 foreach ($urls as $key => $url) {
244 $entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId( 243 $entry = $this->get('wallabag_core.entry_repository')->findByUrlAndUserId(
245 $url, 244 $url,
diff --git a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
index 64c24a2d..b732a8be 100644
--- a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
+++ b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
@@ -774,7 +774,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
774 { 774 {
775 $list = [ 775 $list = [
776 'http://www.lemonde.fr/musiques/article/2017/04/23/loin-de-la-politique-le-printemps-de-bourges-retombe-en-enfance_5115862_1654986.html', 776 'http://www.lemonde.fr/musiques/article/2017/04/23/loin-de-la-politique-le-printemps-de-bourges-retombe-en-enfance_5115862_1654986.html',
777 'http://0.0.0.0/entry6', 777 'http://0.0.0.0/entry1',
778 ]; 778 ];
779 779
780 $this->client->request('POST', '/api/entries/lists?urls='.json_encode($list)); 780 $this->client->request('POST', '/api/entries/lists?urls='.json_encode($list));
@@ -787,13 +787,13 @@ class EntryRestControllerTest extends WallabagApiTestCase
787 $this->assertEquals('http://www.lemonde.fr/musiques/article/2017/04/23/loin-de-la-politique-le-printemps-de-bourges-retombe-en-enfance_5115862_1654986.html', $content[0]['url']); 787 $this->assertEquals('http://www.lemonde.fr/musiques/article/2017/04/23/loin-de-la-politique-le-printemps-de-bourges-retombe-en-enfance_5115862_1654986.html', $content[0]['url']);
788 788
789 $this->assertInternalType('int', $content[1]['entry']); 789 $this->assertInternalType('int', $content[1]['entry']);
790 $this->assertEquals('http://0.0.0.0/entry6', $content[1]['url']); 790 $this->assertEquals('http://0.0.0.0/entry1', $content[1]['url']);
791 } 791 }
792 792
793 public function testDeleteEntriesListAction() 793 public function testDeleteEntriesListAction()
794 { 794 {
795 $list = [ 795 $list = [
796 'http://0.0.0.0/entry2', 796 'http://www.lemonde.fr/musiques/article/2017/04/23/loin-de-la-politique-le-printemps-de-bourges-retombe-en-enfance_5115862_1654986.html',
797 'http://0.0.0.0/entry3', 797 'http://0.0.0.0/entry3',
798 ]; 798 ];
799 799
@@ -804,7 +804,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
804 $content = json_decode($this->client->getResponse()->getContent(), true); 804 $content = json_decode($this->client->getResponse()->getContent(), true);
805 805
806 $this->assertTrue($content[0]['entry']); 806 $this->assertTrue($content[0]['entry']);
807 $this->assertEquals('http://0.0.0.0/entry2', $content[0]['url']); 807 $this->assertEquals('http://www.lemonde.fr/musiques/article/2017/04/23/loin-de-la-politique-le-printemps-de-bourges-retombe-en-enfance_5115862_1654986.html', $content[0]['url']);
808 808
809 $this->assertFalse($content[1]['entry']); 809 $this->assertFalse($content[1]['entry']);
810 $this->assertEquals('http://0.0.0.0/entry3', $content[1]['url']); 810 $this->assertEquals('http://0.0.0.0/entry3', $content[1]['url']);