aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/CoreBundle/Helper/DownloadImagesTest.php
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2016-10-30 11:27:09 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2016-10-30 11:27:09 +0100
commit48656e0eaac006a80f21e9aec8900747fe76283a (patch)
tree8b685bd1b2b68b47a12b2bc17f076683c466603f /tests/Wallabag/CoreBundle/Helper/DownloadImagesTest.php
parent7f55941856549a3f5f45c42fdc171d66ff7ee297 (diff)
downloadwallabag-48656e0eaac006a80f21e9aec8900747fe76283a.tar.gz
wallabag-48656e0eaac006a80f21e9aec8900747fe76283a.tar.zst
wallabag-48656e0eaac006a80f21e9aec8900747fe76283a.zip
Fixing tests
Diffstat (limited to 'tests/Wallabag/CoreBundle/Helper/DownloadImagesTest.php')
-rw-r--r--tests/Wallabag/CoreBundle/Helper/DownloadImagesTest.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/Wallabag/CoreBundle/Helper/DownloadImagesTest.php b/tests/Wallabag/CoreBundle/Helper/DownloadImagesTest.php
index 0273693e..e000d681 100644
--- a/tests/Wallabag/CoreBundle/Helper/DownloadImagesTest.php
+++ b/tests/Wallabag/CoreBundle/Helper/DownloadImagesTest.php
@@ -83,6 +83,25 @@ class DownloadImagesTest extends \PHPUnit_Framework_TestCase
83 $this->assertContains('/assets/images/4/2/4258f71e/ebe60399.'.$extension, $res); 83 $this->assertContains('/assets/images/4/2/4258f71e/ebe60399.'.$extension, $res);
84 } 84 }
85 85
86 public function testProcessSingleImageWithBadUrl()
87 {
88 $client = new Client();
89
90 $mock = new Mock([
91 new Response(404, []),
92 ]);
93
94 $client->getEmitter()->attach($mock);
95
96 $logHandler = new TestHandler();
97 $logger = new Logger('test', array($logHandler));
98
99 $download = new DownloadImages($client, sys_get_temp_dir().'/wallabag_test', $logger);
100 $res = $download->processSingleImage('T9qgcHc.jpg', 'http://imgur.com/gallery/WxtWY');
101
102 $this->assertFalse($res, 'Image can not be found, so it will not be replaced');
103 }
104
86 public function testProcessSingleImageWithBadImage() 105 public function testProcessSingleImageWithBadImage()
87 { 106 {
88 $client = new Client(); 107 $client = new Client();