aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2017-06-12 16:46:33 +0200
committerThomas Citharel <tcit@tcit.fr>2017-06-12 16:46:33 +0200
commit41d45c6122f61e01a370233d26a2633836094d5c (patch)
tree9542e99341091dd2ed49873bf0be617a876461f5
parent977ac0a1d6c5e42d0bb2cbb13eac6213fefbb175 (diff)
downloadwallabag-41d45c6122f61e01a370233d26a2633836094d5c.tar.gz
wallabag-41d45c6122f61e01a370233d26a2633836094d5c.tar.zst
wallabag-41d45c6122f61e01a370233d26a2633836094d5c.zip
Fix empty language and preview pics
-rw-r--r--src/Wallabag/CoreBundle/Helper/ContentProxy.php4
-rw-r--r--tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php
index 0c971863..51bb2ca2 100644
--- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php
+++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php
@@ -120,12 +120,12 @@ class ContentProxy
120 120
121 $this->validateAndSetLanguage( 121 $this->validateAndSetLanguage(
122 $entry, 122 $entry,
123 isset($content['language']) ? $content['language'] : '' 123 isset($content['language']) ? $content['language'] : null
124 ); 124 );
125 125
126 $this->validateAndSetPreviewPicture( 126 $this->validateAndSetPreviewPicture(
127 $entry, 127 $entry,
128 isset($content['open_graph']['og_image']) ? $content['open_graph']['og_image'] : '' 128 isset($content['open_graph']['og_image']) ? $content['open_graph']['og_image'] : null
129 ); 129 );
130 130
131 // if content is an image, define it as a preview too 131 // if content is an image, define it as a preview too
diff --git a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
index 95dd75ba..dbddbc5c 100644
--- a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
+++ b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
@@ -206,7 +206,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
206 $this->assertEquals('http://1.1.1.1', $entry->getUrl()); 206 $this->assertEquals('http://1.1.1.1', $entry->getUrl());
207 $this->assertEquals('this is my title', $entry->getTitle()); 207 $this->assertEquals('this is my title', $entry->getTitle());
208 $this->assertContains('this is my content', $entry->getContent()); 208 $this->assertContains('this is my content', $entry->getContent());
209 $this->assertEmpty($entry->getPreviewPicture()); 209 $this->assertNull($entry->getPreviewPicture());
210 $this->assertEquals('text/html', $entry->getMimetype()); 210 $this->assertEquals('text/html', $entry->getMimetype());
211 $this->assertEquals('fr', $entry->getLanguage()); 211 $this->assertEquals('fr', $entry->getLanguage());
212 $this->assertEquals('200', $entry->getHttpStatus()); 212 $this->assertEquals('200', $entry->getHttpStatus());
@@ -252,7 +252,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
252 $this->assertEquals('this is my title', $entry->getTitle()); 252 $this->assertEquals('this is my title', $entry->getTitle());
253 $this->assertContains('this is my content', $entry->getContent()); 253 $this->assertContains('this is my content', $entry->getContent());
254 $this->assertEquals('text/html', $entry->getMimetype()); 254 $this->assertEquals('text/html', $entry->getMimetype());
255 $this->assertEmpty($entry->getLanguage()); 255 $this->assertNull($entry->getLanguage());
256 $this->assertEquals('200', $entry->getHttpStatus()); 256 $this->assertEquals('200', $entry->getHttpStatus());
257 $this->assertEquals(4.0, $entry->getReadingTime()); 257 $this->assertEquals(4.0, $entry->getReadingTime());
258 $this->assertEquals('1.1.1.1', $entry->getDomainName()); 258 $this->assertEquals('1.1.1.1', $entry->getDomainName());
@@ -300,7 +300,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
300 $this->assertEquals('http://1.1.1.1', $entry->getUrl()); 300 $this->assertEquals('http://1.1.1.1', $entry->getUrl());
301 $this->assertEquals('this is my title', $entry->getTitle()); 301 $this->assertEquals('this is my title', $entry->getTitle());
302 $this->assertContains('this is my content', $entry->getContent()); 302 $this->assertContains('this is my content', $entry->getContent());
303 $this->assertEmpty($entry->getPreviewPicture()); 303 $this->assertNull($entry->getPreviewPicture());
304 $this->assertEquals('text/html', $entry->getMimetype()); 304 $this->assertEquals('text/html', $entry->getMimetype());
305 $this->assertEquals('fr', $entry->getLanguage()); 305 $this->assertEquals('fr', $entry->getLanguage());
306 $this->assertEquals('200', $entry->getHttpStatus()); 306 $this->assertEquals('200', $entry->getHttpStatus());