diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Wallabag/CoreBundle/Helper/DownloadImagesTest.php | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/Wallabag/CoreBundle/Helper/DownloadImagesTest.php b/tests/Wallabag/CoreBundle/Helper/DownloadImagesTest.php index 51ab1bcd..faa803fa 100644 --- a/tests/Wallabag/CoreBundle/Helper/DownloadImagesTest.php +++ b/tests/Wallabag/CoreBundle/Helper/DownloadImagesTest.php | |||
@@ -204,4 +204,27 @@ class DownloadImagesTest extends TestCase | |||
204 | 204 | ||
205 | $this->assertNotContains('http://piketty.blog.lemonde.fr/', $res, 'Image srcset attribute were not replaced'); | 205 | $this->assertNotContains('http://piketty.blog.lemonde.fr/', $res, 'Image srcset attribute were not replaced'); |
206 | } | 206 | } |
207 | |||
208 | public function testProcessImageWithNullPath() | ||
209 | { | ||
210 | $client = new Client(); | ||
211 | |||
212 | $mock = new Mock([ | ||
213 | new Response(200, ['content-type' => null], Stream::factory(file_get_contents(__DIR__ . '/../fixtures/image-no-content-type.jpg'))), | ||
214 | ]); | ||
215 | |||
216 | $client->getEmitter()->attach($mock); | ||
217 | |||
218 | $logHandler = new TestHandler(); | ||
219 | $logger = new Logger('test', [$logHandler]); | ||
220 | |||
221 | $download = new DownloadImages($client, sys_get_temp_dir() . '/wallabag_test', 'http://wallabag.io/', $logger); | ||
222 | |||
223 | $res = $download->processSingleImage( | ||
224 | 123, | ||
225 | null, | ||
226 | 'https://framablog.org/2018/06/30/engagement-atypique/' | ||
227 | ); | ||
228 | $this->assertFalse($res); | ||
229 | } | ||
207 | } | 230 | } |