aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
diff options
context:
space:
mode:
authorJérémy Benoist <j0k3r@users.noreply.github.com>2018-06-07 06:21:06 +0000
committerGitHub <noreply@github.com>2018-06-07 06:21:06 +0000
commitc00a69101902edfa35d8ef06e2f806cda21b9b27 (patch)
treef6f1b5dfd8909e6feca493ff93d797a87c4a688f /tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
parenta550a64c84d8bde4ffe7bba11dbb11cee900cad5 (diff)
parent778543311f5efde4c99321f257c5a9c34a7dea5f (diff)
downloadwallabag-c00a69101902edfa35d8ef06e2f806cda21b9b27.tar.gz
wallabag-c00a69101902edfa35d8ef06e2f806cda21b9b27.tar.zst
wallabag-c00a69101902edfa35d8ef06e2f806cda21b9b27.zip
Merge pull request #3668 from wallabag/fix-tests
Fix tests
Diffstat (limited to 'tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php')
-rw-r--r--tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php34
1 files changed, 17 insertions, 17 deletions
diff --git a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
index 2e9b9305..9722986e 100644
--- a/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
+++ b/tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
@@ -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
@@ -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}