mirror of
https://github.com/wallabag/wallabag.git
synced 2024-12-22 23:56:29 +00:00
Fix tests after rebase
This commit is contained in:
parent
36b0d52ee4
commit
6e68417f03
2 changed files with 12 additions and 14 deletions
|
@ -299,8 +299,6 @@ class ContentProxy
|
|||
// if content is an image, define it as a preview too
|
||||
if (!empty($content['headers']['content-type']) && \in_array($this->mimeGuesser->guess($content['headers']['content-type']), ['jpeg', 'jpg', 'gif', 'png'], true)) {
|
||||
$previewPictureUrl = $content['url'];
|
||||
|
||||
$entry->setMimetype($content['headers']['content-type']);
|
||||
} elseif (empty($previewPictureUrl)) {
|
||||
$this->logger->debug('Extracting images from content to provide a default preview picture');
|
||||
$imagesUrls = DownloadImages::extractImagesUrlsFromHtml($content['html']);
|
||||
|
@ -311,6 +309,10 @@ class ContentProxy
|
|||
}
|
||||
}
|
||||
|
||||
if (!empty($content['headers']['content-type'])) {
|
||||
$entry->setMimetype($content['headers']['content-type']);
|
||||
}
|
||||
|
||||
if (!empty($previewPictureUrl)) {
|
||||
$this->updatePreviewPicture($entry, $previewPictureUrl);
|
||||
}
|
||||
|
|
|
@ -232,14 +232,12 @@ class ContentProxyTest extends TestCase
|
|||
'html' => "<h1>Test</h1><p><img src='http://3.3.3.3/cover.jpg'/></p>",
|
||||
'title' => 'this is my title',
|
||||
'url' => 'http://1.1.1.1',
|
||||
'content_type' => 'text/html',
|
||||
'headers' => [
|
||||
'content-type' => 'text/html',
|
||||
],
|
||||
'language' => 'fr',
|
||||
'status' => '200',
|
||||
'open_graph' => [
|
||||
'og_title' => 'my OG title',
|
||||
'og_description' => 'OG desc',
|
||||
'og_image' => null,
|
||||
],
|
||||
'image' => null,
|
||||
]);
|
||||
|
||||
$proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage);
|
||||
|
@ -274,14 +272,12 @@ class ContentProxyTest extends TestCase
|
|||
'html' => "<h1>Test</h1><p><img src='http://3.3.3.3/nevermind.jpg'/></p>",
|
||||
'title' => 'this is my title',
|
||||
'url' => 'http://1.1.1.1',
|
||||
'content_type' => 'text/html',
|
||||
'headers' => [
|
||||
'content-type' => 'text/html',
|
||||
],
|
||||
'language' => 'fr',
|
||||
'status' => '200',
|
||||
'open_graph' => [
|
||||
'og_title' => 'my OG title',
|
||||
'og_description' => 'OG desc',
|
||||
'og_image' => 'http://3.3.3.3/cover.jpg',
|
||||
],
|
||||
'image' => 'http://3.3.3.3/cover.jpg',
|
||||
]);
|
||||
|
||||
$proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage);
|
||||
|
|
Loading…
Reference in a new issue