]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
Fix empty language and preview pics 3215/head
authorThomas Citharel <tcit@tcit.fr>
Mon, 12 Jun 2017 14:46:33 +0000 (16:46 +0200)
committerThomas Citharel <tcit@tcit.fr>
Mon, 12 Jun 2017 14:46:33 +0000 (16:46 +0200)
src/Wallabag/CoreBundle/Helper/ContentProxy.php
tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php

index 0c971863bcd670957a7f4c0f6d172d98bebdf4f0..51bb2ca2d73e4cbc447f8c4fcdb7502cd5e1d767 100644 (file)
@@ -120,12 +120,12 @@ class ContentProxy
 
         $this->validateAndSetLanguage(
             $entry,
-            isset($content['language']) ? $content['language'] : ''
+            isset($content['language']) ? $content['language'] : null
         );
 
         $this->validateAndSetPreviewPicture(
             $entry,
-            isset($content['open_graph']['og_image']) ? $content['open_graph']['og_image'] : ''
+            isset($content['open_graph']['og_image']) ? $content['open_graph']['og_image'] : null
         );
 
         // if content is an image, define it as a preview too
index 95dd75ba8c3ebe9629f92ac06defe38b2a1a4bf9..dbddbc5c6776eac8d0ae1d53c42f3159e0d9fd02 100644 (file)
@@ -206,7 +206,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
         $this->assertEquals('http://1.1.1.1', $entry->getUrl());
         $this->assertEquals('this is my title', $entry->getTitle());
         $this->assertContains('this is my content', $entry->getContent());
-        $this->assertEmpty($entry->getPreviewPicture());
+        $this->assertNull($entry->getPreviewPicture());
         $this->assertEquals('text/html', $entry->getMimetype());
         $this->assertEquals('fr', $entry->getLanguage());
         $this->assertEquals('200', $entry->getHttpStatus());
@@ -252,7 +252,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
         $this->assertEquals('this is my title', $entry->getTitle());
         $this->assertContains('this is my content', $entry->getContent());
         $this->assertEquals('text/html', $entry->getMimetype());
-        $this->assertEmpty($entry->getLanguage());
+        $this->assertNull($entry->getLanguage());
         $this->assertEquals('200', $entry->getHttpStatus());
         $this->assertEquals(4.0, $entry->getReadingTime());
         $this->assertEquals('1.1.1.1', $entry->getDomainName());
@@ -300,7 +300,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
         $this->assertEquals('http://1.1.1.1', $entry->getUrl());
         $this->assertEquals('this is my title', $entry->getTitle());
         $this->assertContains('this is my content', $entry->getContent());
-        $this->assertEmpty($entry->getPreviewPicture());
+        $this->assertNull($entry->getPreviewPicture());
         $this->assertEquals('text/html', $entry->getMimetype());
         $this->assertEquals('fr', $entry->getLanguage());
         $this->assertEquals('200', $entry->getHttpStatus());