From 84b3bdaac00f3781929779d2ad1fb205aad1ea86 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Fri, 21 Sep 2018 08:56:20 +0200 Subject: [PATCH] Liberation goes https --- .../CoreBundle/Controller/EntryControllerTest.php | 3 ++- .../Controller/InstapaperControllerTest.php | 10 ++++++---- .../Controller/WallabagV2ControllerTest.php | 8 ++++---- .../ImportBundle/fixtures/instapaper-export.csv | 2 +- tests/Wallabag/ImportBundle/fixtures/wallabag-v2.json | 2 +- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index 3d599ec8..bf0068b4 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php @@ -174,7 +174,7 @@ class EntryControllerTest extends WallabagCoreTestCase public function testPostWithMultipleAuthors() { - $url = 'http://www.liberation.fr/planete/2017/04/05/donald-trump-et-xi-jinping-tentative-de-flirt-en-floride_1560768'; + $url = 'https://www.liberation.fr/planete/2017/04/05/donald-trump-et-xi-jinping-tentative-de-flirt-en-floride_1560768'; $this->logInAs('admin'); $client = $this->getClient(); @@ -197,6 +197,7 @@ class EntryControllerTest extends WallabagCoreTestCase ->getRepository('WallabagCoreBundle:Entry') ->findByUrlAndUserId($url, $this->getLoggedInUserId()); + $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content); $authors = $content->getPublishedBy(); $this->assertSame('2017-04-05 19:26:13', $content->getPublishedAt()->format('Y-m-d H:i:s')); $this->assertSame('fr', $content->getLanguage()); diff --git a/tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php b/tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php index 80bfc3b4..7390fa88 100644 --- a/tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/InstapaperControllerTest.php @@ -114,13 +114,15 @@ class InstapaperControllerTest extends WallabagCoreTestCase ->get('doctrine.orm.entity_manager') ->getRepository('WallabagCoreBundle:Entry') ->findByUrlAndUserId( - 'http://www.liberation.fr/societe/2012/12/06/baumettes-un-tour-en-cellule_865551', + 'https://www.liberation.fr/societe/2012/12/06/baumettes-un-tour-en-cellule_865551', $this->getLoggedInUserId() ); - $this->assertNotEmpty($content->getMimetype(), 'Mimetype for http://www.liberation.fr is ok'); - $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for http://www.liberation.fr is ok'); - $this->assertNotEmpty($content->getLanguage(), 'Language for http://www.liberation.fr is ok'); + $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content); + + $this->assertNotEmpty($content->getMimetype(), 'Mimetype for https://www.liberation.fr is ok'); + $this->assertNotEmpty($content->getPreviewPicture(), 'Preview picture for https://www.liberation.fr is ok'); + $this->assertNotEmpty($content->getLanguage(), 'Language for https://www.liberation.fr is ok'); $this->assertContains('foot', $content->getTags(), 'It includes the "foot" tag'); $this->assertSame(1, \count($content->getTags())); $this->assertInstanceOf(\DateTime::class, $content->getCreatedAt()); diff --git a/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php b/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php index 67490714..822656ba 100644 --- a/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/WallabagV2ControllerTest.php @@ -115,16 +115,16 @@ class WallabagV2ControllerTest extends WallabagCoreTestCase ->get('doctrine.orm.entity_manager') ->getRepository('WallabagCoreBundle:Entry') ->findByUrlAndUserId( - 'http://www.liberation.fr/planete/2015/10/26/refugies-l-ue-va-creer-100-000-places-d-accueil-dans-les-balkans_1408867', + 'https://www.liberation.fr/planete/2015/10/26/refugies-l-ue-va-creer-100-000-places-d-accueil-dans-les-balkans_1408867', $this->getLoggedInUserId() ); $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $content); // empty because it wasn't re-imported - $this->assertEmpty($content->getMimetype(), 'Mimetype for http://www.liberation.fr is empty'); - $this->assertEmpty($content->getPreviewPicture(), 'Preview picture for http://www.liberation.fr is empty'); - $this->assertEmpty($content->getLanguage(), 'Language for http://www.liberation.fr is empty'); + $this->assertEmpty($content->getMimetype(), 'Mimetype for https://www.liberation.fr is empty'); + $this->assertEmpty($content->getPreviewPicture(), 'Preview picture for https://www.liberation.fr is empty'); + $this->assertEmpty($content->getLanguage(), 'Language for https://www.liberation.fr is empty'); $tags = $content->getTags(); $this->assertContains('foot', $tags, 'It includes the "foot" tag'); diff --git a/tests/Wallabag/ImportBundle/fixtures/instapaper-export.csv b/tests/Wallabag/ImportBundle/fixtures/instapaper-export.csv index 7b692d00..5380bf2c 100644 --- a/tests/Wallabag/ImportBundle/fixtures/instapaper-export.csv +++ b/tests/Wallabag/ImportBundle/fixtures/instapaper-export.csv @@ -1,5 +1,5 @@ URL,Title,Selection,Folder -http://www.liberation.fr/societe/2012/12/06/baumettes-un-tour-en-cellule_865551,Baumettes : un tour en cellule,,Unread +https://www.liberation.fr/societe/2012/12/06/baumettes-un-tour-en-cellule_865551,Baumettes : un tour en cellule,,Unread https://redditblog.com/2016/09/20/amp-and-reactredux/,AMP and React+Redux: Why Not?,,Archive https://medium.com/@the_minh/why-foursquare-swarm-is-still-my-favourite-social-network-e38228493e6c,Why Foursquare / Swarm is still my favourite social network,,Starred https://www.20minutes.fr/high-tech/2077615-20170531-quoi-exactement-tweet-covfefe-donald-trump-persiste-signe,"Dis donc Donald Trump, c'est quoi exactement «covfefe»?",,test_tag diff --git a/tests/Wallabag/ImportBundle/fixtures/wallabag-v2.json b/tests/Wallabag/ImportBundle/fixtures/wallabag-v2.json index 63c44cf9..a2142f90 100644 --- a/tests/Wallabag/ImportBundle/fixtures/wallabag-v2.json +++ b/tests/Wallabag/ImportBundle/fixtures/wallabag-v2.json @@ -21,7 +21,7 @@ { "id": 22, "title": "Réfugiés: l'UE va créer 100 000 places d'accueil dans les Balkans", - "url": "http://www.liberation.fr/planete/2015/10/26/refugies-l-ue-va-creer-100-000-places-d-accueil-dans-les-balkans_1408867", + "url": "https://www.liberation.fr/planete/2015/10/26/refugies-l-ue-va-creer-100-000-places-d-accueil-dans-les-balkans_1408867", "is_archived": false, "created_at": "2016-09-08T11:55:58+0200", "updated_at": "2016-09-08T11:57:16+0200", -- 2.41.0