diff options
author | adev <adev2000@gmail.com> | 2017-11-11 23:20:46 +0100 |
---|---|---|
committer | adev <adev2000@gmail.com> | 2017-11-11 23:37:57 +0100 |
commit | d81bf605af9d8b9de12d40b25298d238cb08b630 (patch) | |
tree | f4a687baed19ca9a6e071cda8f029fcdf109c780 /tests | |
parent | f39cfa469094fb9efd5e8007b44c2d62b617f358 (diff) | |
download | wallabag-d81bf605af9d8b9de12d40b25298d238cb08b630.tar.gz wallabag-d81bf605af9d8b9de12d40b25298d238cb08b630.tar.zst wallabag-d81bf605af9d8b9de12d40b25298d238cb08b630.zip |
Fix tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php | 11 | ||||
-rw-r--r-- | tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php | 2 |
2 files changed, 7 insertions, 6 deletions
diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php index ca275b32..12a74f49 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php | |||
@@ -11,6 +11,7 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
11 | { | 11 | { |
12 | public $downloadImagesEnabled = false; | 12 | public $downloadImagesEnabled = false; |
13 | public $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'; | 13 | public $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'; |
14 | const An_URL_CONTAINING_AN_ARTICLE_WITH_IMAGE = 'http://www.lemonde.fr/judo/article/2017/11/11/judo-la-decima-de-teddy-riner_5213605_1556020.html'; | ||
14 | 15 | ||
15 | /** | 16 | /** |
16 | * @after | 17 | * @after |
@@ -161,7 +162,7 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
161 | $this->assertSame($this->url, $content->getUrl()); | 162 | $this->assertSame($this->url, $content->getUrl()); |
162 | $this->assertContains('Google', $content->getTitle()); | 163 | $this->assertContains('Google', $content->getTitle()); |
163 | $this->assertSame('fr', $content->getLanguage()); | 164 | $this->assertSame('fr', $content->getLanguage()); |
164 | $this->assertSame('2015-03-28 15:37:39', $content->getPublishedAt()->format('Y-m-d H:i:s')); | 165 | $this->assertSame('2015-03-28 11:43:19', $content->getPublishedAt()->format('Y-m-d H:i:s')); |
165 | $this->assertSame('Morgane Tual', $author[0]); | 166 | $this->assertSame('Morgane Tual', $author[0]); |
166 | $this->assertArrayHasKey('x-varnish1', $content->getHeaders()); | 167 | $this->assertArrayHasKey('x-varnish1', $content->getHeaders()); |
167 | } | 168 | } |
@@ -977,7 +978,7 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
977 | $this->logInAs('admin'); | 978 | $this->logInAs('admin'); |
978 | $client = $this->getClient(); | 979 | $client = $this->getClient(); |
979 | 980 | ||
980 | $url = 'http://www.20minutes.fr/montpellier/1952003-20161030-video-car-tombe-panne-rugbymen-perpignan-improvisent-melee-route'; | 981 | $url = self::An_URL_CONTAINING_AN_ARTICLE_WITH_IMAGE; |
981 | $client->getContainer()->get('craue_config')->set('download_images_enabled', 1); | 982 | $client->getContainer()->get('craue_config')->set('download_images_enabled', 1); |
982 | 983 | ||
983 | $crawler = $client->request('GET', '/new'); | 984 | $crawler = $client->request('GET', '/new'); |
@@ -1003,9 +1004,9 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
1003 | 1004 | ||
1004 | $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $entry); | 1005 | $this->assertInstanceOf('Wallabag\CoreBundle\Entity\Entry', $entry); |
1005 | $this->assertSame($url, $entry->getUrl()); | 1006 | $this->assertSame($url, $entry->getUrl()); |
1006 | $this->assertContains('Perpignan', $entry->getTitle()); | 1007 | $this->assertContains('Judo', $entry->getTitle()); |
1007 | // instead of checking for the filename (which might change) check that the image is now local | 1008 | // instead of checking for the filename (which might change) check that the image is now local |
1008 | $this->assertContains($client->getContainer()->getParameter('domain_name') . '/assets/images/', $entry->getContent()); | 1009 | $this->assertContains(rtrim($client->getContainer()->getParameter('domain_name'), '/') . '/assets/images/', $entry->getContent()); |
1009 | 1010 | ||
1010 | $client->getContainer()->get('craue_config')->set('download_images_enabled', 0); | 1011 | $client->getContainer()->get('craue_config')->set('download_images_enabled', 0); |
1011 | } | 1012 | } |
@@ -1019,7 +1020,7 @@ class EntryControllerTest extends WallabagCoreTestCase | |||
1019 | $this->logInAs('admin'); | 1020 | $this->logInAs('admin'); |
1020 | $client = $this->getClient(); | 1021 | $client = $this->getClient(); |
1021 | 1022 | ||
1022 | $url = 'http://www.20minutes.fr/montpellier/1952003-20161030-video-car-tombe-panne-rugbymen-perpignan-improvisent-melee-route'; | 1023 | $url = self::An_URL_CONTAINING_AN_ARTICLE_WITH_IMAGE; |
1023 | $client->getContainer()->get('craue_config')->set('download_images_enabled', 1); | 1024 | $client->getContainer()->get('craue_config')->set('download_images_enabled', 1); |
1024 | 1025 | ||
1025 | $crawler = $client->request('GET', '/new'); | 1026 | $crawler = $client->request('GET', '/new'); |
diff --git a/tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php b/tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php index 933fffa2..dc9d9a8f 100644 --- a/tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php +++ b/tests/Wallabag/ImportBundle/Controller/FirefoxControllerTest.php | |||
@@ -114,7 +114,7 @@ class FirefoxControllerTest extends WallabagCoreTestCase | |||
114 | ->get('doctrine.orm.entity_manager') | 114 | ->get('doctrine.orm.entity_manager') |
115 | ->getRepository('WallabagCoreBundle:Entry') | 115 | ->getRepository('WallabagCoreBundle:Entry') |
116 | ->findByUrlAndUserId( | 116 | ->findByUrlAndUserId( |
117 | 'http://lexpansion.lexpress.fr/high-tech/orange-offre-un-meilleur-reseau-mobile-que-bouygues-et-sfr-free-derriere_1811554.html', | 117 | 'https://lexpansion.lexpress.fr/high-tech/orange-offre-un-meilleur-reseau-mobile-que-bouygues-et-sfr-free-derriere_1811554.html', |
118 | $this->getLoggedInUserId() | 118 | $this->getLoggedInUserId() |
119 | ); | 119 | ); |
120 | 120 | ||