X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=tests%2FWallabag%2FCoreBundle%2FHelper%2FContentProxyTest.php;h=9ce72c79c1277ec08ded6eb7f3d8b4265cc4fdf7;hb=2495b197614d82b99eed6bbec4562078f4429ad7;hp=40a6cc802d0f6701fd12e83c4a1f9ba95c5e6577;hpb=5f08426201c336f96d593954fb45b284d7e60f4a;p=github%2Fwallabag%2Fwallabag.git diff --git a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php index 40a6cc80..9ce72c79 100644 --- a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php +++ b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php @@ -36,7 +36,9 @@ class ContentProxyTest extends TestCase 'html' => false, 'title' => '', 'url' => '', - 'content_type' => '', + 'headers' => [ + 'content-type' => '', + ], 'language' => '', ]); @@ -71,7 +73,9 @@ class ContentProxyTest extends TestCase 'html' => false, 'title' => '', 'url' => '', - 'content_type' => '', + 'headers' => [ + 'content-type' => '', + ], 'language' => '', ]); @@ -106,7 +110,9 @@ class ContentProxyTest extends TestCase 'html' => false, 'title' => 'my title', 'url' => '', - 'content_type' => '', + 'headers' => [ + 'content-type' => '', + ], 'language' => '', 'status' => '', 'description' => 'desc', @@ -226,14 +232,12 @@ class ContentProxyTest extends TestCase 'html' => "

Test

", '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); @@ -268,14 +272,12 @@ class ContentProxyTest extends TestCase 'html' => "

Test

", '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); @@ -361,14 +363,13 @@ class ContentProxyTest extends TestCase 'html' => str_repeat('this is my content', 325), 'title' => 'this is my title', 'url' => 'http://1.1.1.1', - 'content_type' => 'text/html', + 'headers' => [ + 'content-type' => 'text/html', + ], 'language' => 'fr', 'status' => '200', 'description' => 'OG desc', 'image' => 'https://', - 'headers' => [ - 'content-type' => 'text/html', - ], ]); $proxy = new ContentProxy($graby, $tagger, $validator, $this->getLogger(), $this->fetchingErrorMessage); @@ -641,7 +642,9 @@ class ContentProxyTest extends TestCase 'html' => false, 'title' => $actualTitle, 'url' => '', - 'content_type' => 'text/html', + 'headers' => [ + 'content-type' => 'text/html', + ], 'language' => '', ]); @@ -676,7 +679,9 @@ class ContentProxyTest extends TestCase 'html' => false, 'title' => $actualTitle, 'url' => '', - 'content_type' => 'text/html', + 'headers' => [ + 'content-type' => 'text/html', + ], 'language' => '', ]); @@ -710,7 +715,9 @@ class ContentProxyTest extends TestCase 'html' => false, 'title' => $actualTitle, 'url' => '', - 'content_type' => 'application/pdf', + 'headers' => [ + 'content-type' => 'application/pdf', + ], 'language' => '', ]); @@ -744,7 +751,9 @@ class ContentProxyTest extends TestCase 'html' => false, 'title' => $actualTitle, 'url' => '', - 'content_type' => 'application/pdf', + 'headers' => [ + 'content-type' => 'application/pdf', + ], 'language' => '', ]); @@ -778,7 +787,9 @@ class ContentProxyTest extends TestCase 'html' => false, 'title' => $actualTitle, 'url' => '', - 'content_type' => 'application/pdf', + 'headers' => [ + 'content-type' => 'application/pdf', + ], 'language' => '', ]); @@ -813,7 +824,9 @@ class ContentProxyTest extends TestCase 'html' => false, 'title' => $actualTitle, 'url' => '', - 'content_type' => 'application/pdf', + 'headers' => [ + 'content-type' => 'application/pdf', + ], 'language' => '', ]); @@ -943,7 +956,9 @@ class ContentProxyTest extends TestCase 'html' => false, 'title' => '', 'url' => $content_url, - 'content_type' => '', + 'headers' => [ + 'content-type' => '', + ], 'language' => '', ], true @@ -974,7 +989,9 @@ class ContentProxyTest extends TestCase } /** - * https://stackoverflow.com/a/18506801. + * Convert hex to string. + * + * @see https://stackoverflow.com/a/18506801 * * @param $hex *