diff options
author | Jérémy Benoist <j0k3r@users.noreply.github.com> | 2017-11-12 11:33:18 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-12 11:33:18 +0100 |
commit | 2a4a861b34b8ada5561345621c06ddb969303275 (patch) | |
tree | a04aa13666325d6ba68ba015c66fa657bd58cef1 /tests | |
parent | f39cfa469094fb9efd5e8007b44c2d62b617f358 (diff) | |
parent | cc797127388d2877541062309399783a97111a7d (diff) | |
download | wallabag-2a4a861b34b8ada5561345621c06ddb969303275.tar.gz wallabag-2a4a861b34b8ada5561345621c06ddb969303275.tar.zst wallabag-2a4a861b34b8ada5561345621c06ddb969303275.zip |
Merge pull request #3412 from aaa2000/fix-tests
Fix the 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..6e806553 100644 --- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php | |||
@@ -9,6 +9,7 @@ use Wallabag\CoreBundle\Entity\SiteCredential; | |||
9 | 9 | ||
10 | class EntryControllerTest extends WallabagCoreTestCase | 10 | class EntryControllerTest extends WallabagCoreTestCase |
11 | { | 11 | { |
12 | 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'; | ||
12 | public $downloadImagesEnabled = false; | 13 | 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'; | 14 | 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 | 15 | ||
@@ -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 | ||