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/DeveloperControllerTest.php4
-rw-r--r--tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php64
2 files changed, 34 insertions, 34 deletions
diff --git a/tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php b/tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php
index 35de47f9..f58d1c12 100644
--- a/tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php
+++ b/tests/Wallabag/ApiBundle/Controller/DeveloperControllerTest.php
@@ -28,7 +28,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
28 $this->assertSame(200, $client->getResponse()->getStatusCode()); 28 $this->assertSame(200, $client->getResponse()->getStatusCode());
29 29
30 $newNbClients = $em->getRepository('WallabagApiBundle:Client')->findAll(); 30 $newNbClients = $em->getRepository('WallabagApiBundle:Client')->findAll();
31 $this->assertGreaterThan(count($nbClients), count($newNbClients)); 31 $this->assertGreaterThan(\count($nbClients), \count($newNbClients));
32 32
33 $this->assertGreaterThan(1, $alert = $crawler->filter('.settings ul li strong')->extract(['_text'])); 33 $this->assertGreaterThan(1, $alert = $crawler->filter('.settings ul li strong')->extract(['_text']));
34 $this->assertContains('My app', $alert[0]); 34 $this->assertContains('My app', $alert[0]);
@@ -65,7 +65,7 @@ class DeveloperControllerTest extends WallabagCoreTestCase
65 65
66 $crawler = $client->request('GET', '/developer'); 66 $crawler = $client->request('GET', '/developer');
67 $this->assertSame(200, $client->getResponse()->getStatusCode()); 67 $this->assertSame(200, $client->getResponse()->getStatusCode());
68 $this->assertSame(count($nbClients), $crawler->filter('ul[class=collapsible] li')->count()); 68 $this->assertSame(\count($nbClients), $crawler->filter('ul[class=collapsible] li')->count());
69 } 69 }
70 70
71 public function testDeveloperHowto() 71 public function testDeveloperHowto()
diff --git a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
index 2e9b9305..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']);
@@ -419,7 +419,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
419 public function testPostEntry() 419 public function testPostEntry()
420 { 420 {
421 $this->client->request('POST', '/api/entries.json', [ 421 $this->client->request('POST', '/api/entries.json', [
422 'url' => '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', 422 'url' => 'https://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',
423 'tags' => 'google', 423 'tags' => 'google',
424 'title' => 'New title for my article', 424 'title' => 'New title for my article',
425 'content' => 'my content', 425 'content' => 'my content',
@@ -434,7 +434,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
434 $content = json_decode($this->client->getResponse()->getContent(), true); 434 $content = json_decode($this->client->getResponse()->getContent(), true);
435 435
436 $this->assertGreaterThan(0, $content['id']); 436 $this->assertGreaterThan(0, $content['id']);
437 $this->assertSame('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']); 437 $this->assertSame('https://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']);
438 $this->assertSame(0, $content['is_archived']); 438 $this->assertSame(0, $content['is_archived']);
439 $this->assertSame(0, $content['is_starred']); 439 $this->assertSame(0, $content['is_starred']);
440 $this->assertNull($content['starred_at']); 440 $this->assertNull($content['starred_at']);
@@ -455,7 +455,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
455 { 455 {
456 $em = $this->client->getContainer()->get('doctrine.orm.entity_manager'); 456 $em = $this->client->getContainer()->get('doctrine.orm.entity_manager');
457 $entry = new Entry($em->getReference(User::class, 1)); 457 $entry = new Entry($em->getReference(User::class, 1));
458 $entry->setUrl('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'); 458 $entry->setUrl('https://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');
459 $entry->setArchived(true); 459 $entry->setArchived(true);
460 $entry->addTag((new Tag())->setLabel('google')); 460 $entry->addTag((new Tag())->setLabel('google'));
461 $entry->addTag((new Tag())->setLabel('apple')); 461 $entry->addTag((new Tag())->setLabel('apple'));
@@ -464,7 +464,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
464 $em->clear(); 464 $em->clear();
465 465
466 $this->client->request('POST', '/api/entries.json', [ 466 $this->client->request('POST', '/api/entries.json', [
467 'url' => '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', 467 'url' => 'https://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',
468 'archive' => '1', 468 'archive' => '1',
469 'tags' => 'google, apple', 469 'tags' => 'google, apple',
470 ]); 470 ]);
@@ -474,7 +474,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
474 $content = json_decode($this->client->getResponse()->getContent(), true); 474 $content = json_decode($this->client->getResponse()->getContent(), true);
475 475
476 $this->assertGreaterThan(0, $content['id']); 476 $this->assertGreaterThan(0, $content['id']);
477 $this->assertSame('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']); 477 $this->assertSame('https://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']);
478 $this->assertSame(1, $content['is_archived']); 478 $this->assertSame(1, $content['is_archived']);
479 $this->assertSame(0, $content['is_starred']); 479 $this->assertSame(0, $content['is_starred']);
480 $this->assertCount(3, $content['tags']); 480 $this->assertCount(3, $content['tags']);
@@ -519,7 +519,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
519 { 519 {
520 $now = new \DateTime(); 520 $now = new \DateTime();
521 $this->client->request('POST', '/api/entries.json', [ 521 $this->client->request('POST', '/api/entries.json', [
522 'url' => 'http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', 522 'url' => 'https://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html',
523 'archive' => '1', 523 'archive' => '1',
524 'starred' => '1', 524 'starred' => '1',
525 ]); 525 ]);
@@ -529,7 +529,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
529 $content = json_decode($this->client->getResponse()->getContent(), true); 529 $content = json_decode($this->client->getResponse()->getContent(), true);
530 530
531 $this->assertGreaterThan(0, $content['id']); 531 $this->assertGreaterThan(0, $content['id']);
532 $this->assertSame('http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', $content['url']); 532 $this->assertSame('https://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', $content['url']);
533 $this->assertSame(1, $content['is_archived']); 533 $this->assertSame(1, $content['is_archived']);
534 $this->assertSame(1, $content['is_starred']); 534 $this->assertSame(1, $content['is_starred']);
535 $this->assertGreaterThanOrEqual($now->getTimestamp(), (new \DateTime($content['starred_at']))->getTimestamp()); 535 $this->assertGreaterThanOrEqual($now->getTimestamp(), (new \DateTime($content['starred_at']))->getTimestamp());
@@ -539,7 +539,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
539 public function testPostArchivedAndStarredEntryWithoutQuotes() 539 public function testPostArchivedAndStarredEntryWithoutQuotes()
540 { 540 {
541 $this->client->request('POST', '/api/entries.json', [ 541 $this->client->request('POST', '/api/entries.json', [
542 'url' => 'http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', 542 'url' => 'https://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html',
543 'archive' => 0, 543 'archive' => 0,
544 'starred' => 1, 544 'starred' => 1,
545 ]); 545 ]);
@@ -549,7 +549,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
549 $content = json_decode($this->client->getResponse()->getContent(), true); 549 $content = json_decode($this->client->getResponse()->getContent(), true);
550 550
551 $this->assertGreaterThan(0, $content['id']); 551 $this->assertGreaterThan(0, $content['id']);
552 $this->assertSame('http://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', $content['url']); 552 $this->assertSame('https://www.lemonde.fr/idees/article/2016/02/08/preserver-la-liberte-d-expression-sur-les-reseaux-sociaux_4861503_3232.html', $content['url']);
553 $this->assertSame(0, $content['is_archived']); 553 $this->assertSame(0, $content['is_archived']);
554 $this->assertSame(1, $content['is_starred']); 554 $this->assertSame(1, $content['is_starred']);
555 } 555 }
@@ -557,7 +557,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
557 public function testPostEntryWithOriginUrl() 557 public function testPostEntryWithOriginUrl()
558 { 558 {
559 $this->client->request('POST', '/api/entries.json', [ 559 $this->client->request('POST', '/api/entries.json', [
560 'url' => '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', 560 'url' => 'https://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',
561 'tags' => 'google', 561 'tags' => 'google',
562 'title' => 'New title for my article', 562 'title' => 'New title for my article',
563 'content' => 'my content', 563 'content' => 'my content',
@@ -573,7 +573,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
573 $content = json_decode($this->client->getResponse()->getContent(), true); 573 $content = json_decode($this->client->getResponse()->getContent(), true);
574 574
575 $this->assertGreaterThan(0, $content['id']); 575 $this->assertGreaterThan(0, $content['id']);
576 $this->assertSame('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']); 576 $this->assertSame('https://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']);
577 $this->assertSame('http://mysource.tld', $content['origin_url']); 577 $this->assertSame('http://mysource.tld', $content['origin_url']);
578 } 578 }
579 579
@@ -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()
@@ -1013,7 +1013,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
1013 public function testReloadEntry() 1013 public function testReloadEntry()
1014 { 1014 {
1015 $this->client->request('POST', '/api/entries.json', [ 1015 $this->client->request('POST', '/api/entries.json', [
1016 'url' => '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', 1016 'url' => 'https://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',
1017 'archive' => '1', 1017 'archive' => '1',
1018 'tags' => 'google, apple', 1018 'tags' => 'google, apple',
1019 ]); 1019 ]);
@@ -1117,7 +1117,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
1117 public function testPostEntriesListAction() 1117 public function testPostEntriesListAction()
1118 { 1118 {
1119 $list = [ 1119 $list = [
1120 'http://www.lemonde.fr/musiques/article/2017/04/23/loin-de-la-politique-le-printemps-de-bourges-retombe-en-enfance_5115862_1654986.html', 1120 'https://www.lemonde.fr/musiques/article/2017/04/23/loin-de-la-politique-le-printemps-de-bourges-retombe-en-enfance_5115862_1654986.html',
1121 'http://0.0.0.0/entry2', 1121 'http://0.0.0.0/entry2',
1122 ]; 1122 ];
1123 1123
@@ -1128,7 +1128,7 @@ class EntryRestControllerTest extends WallabagApiTestCase
1128 $content = json_decode($this->client->getResponse()->getContent(), true); 1128 $content = json_decode($this->client->getResponse()->getContent(), true);
1129 1129
1130 $this->assertInternalType('int', $content[0]['entry']); 1130 $this->assertInternalType('int', $content[0]['entry']);
1131 $this->assertSame('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']); 1131 $this->assertSame('https://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']);
1132 1132
1133 $this->assertInternalType('int', $content[1]['entry']); 1133 $this->assertInternalType('int', $content[1]['entry']);
1134 $this->assertSame('http://0.0.0.0/entry2', $content[1]['url']); 1134 $this->assertSame('http://0.0.0.0/entry2', $content[1]['url']);
@@ -1209,14 +1209,14 @@ class EntryRestControllerTest extends WallabagApiTestCase
1209 $entry = new Entry($em->getReference(User::class, 1)); 1209 $entry = new Entry($em->getReference(User::class, 1));
1210 $entry->setTitle('Antoine de Caunes : « Je veux avoir le droit de tâtonner »'); 1210 $entry->setTitle('Antoine de Caunes : « Je veux avoir le droit de tâtonner »');
1211 $entry->setContent('hihi'); 1211 $entry->setContent('hihi');
1212 $entry->setUrl('http://www.lemonde.fr/m-perso/article/2017/06/25/antoine-de-caunes-je-veux-avoir-le-droit-de-tatonner_5150728_4497916.html'); 1212 $entry->setUrl('https://www.lemonde.fr/m-perso/article/2017/06/25/antoine-de-caunes-je-veux-avoir-le-droit-de-tatonner_5150728_4497916.html');
1213 $entry->setPublishedAt(new \DateTime('2017-06-26T07:46:02+0200')); 1213 $entry->setPublishedAt(new \DateTime('2017-06-26T07:46:02+0200'));
1214 $em->persist($entry); 1214 $em->persist($entry);
1215 $em->flush(); 1215 $em->flush();
1216 $em->clear(); 1216 $em->clear();
1217 1217
1218 $this->client->request('POST', '/api/entries.json', [ 1218 $this->client->request('POST', '/api/entries.json', [
1219 'url' => 'http://www.lemonde.fr/m-perso/article/2017/06/25/antoine-de-caunes-je-veux-avoir-le-droit-de-tatonner_5150728_4497916.html', 1219 'url' => 'https://www.lemonde.fr/m-perso/article/2017/06/25/antoine-de-caunes-je-veux-avoir-le-droit-de-tatonner_5150728_4497916.html',
1220 ]); 1220 ]);
1221 1221
1222 $this->assertSame(200, $this->client->getResponse()->getStatusCode()); 1222 $this->assertSame(200, $this->client->getResponse()->getStatusCode());
@@ -1224,6 +1224,6 @@ class EntryRestControllerTest extends WallabagApiTestCase
1224 $content = json_decode($this->client->getResponse()->getContent(), true); 1224 $content = json_decode($this->client->getResponse()->getContent(), true);
1225 1225
1226 $this->assertGreaterThan(0, $content['id']); 1226 $this->assertGreaterThan(0, $content['id']);
1227 $this->assertSame('http://www.lemonde.fr/m-perso/article/2017/06/25/antoine-de-caunes-je-veux-avoir-le-droit-de-tatonner_5150728_4497916.html', $content['url']); 1227 $this->assertSame('https://www.lemonde.fr/m-perso/article/2017/06/25/antoine-de-caunes-je-veux-avoir-le-droit-de-tatonner_5150728_4497916.html', $content['url']);
1228 } 1228 }
1229} 1229}