diff options
Diffstat (limited to 'tests/Wallabag')
-rw-r--r-- | tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php | 51 |
1 files changed, 36 insertions, 15 deletions
diff --git a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php index 40a6cc80..c123e7e6 100644 --- a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php +++ b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php | |||
@@ -36,7 +36,9 @@ class ContentProxyTest extends TestCase | |||
36 | 'html' => false, | 36 | 'html' => false, |
37 | 'title' => '', | 37 | 'title' => '', |
38 | 'url' => '', | 38 | 'url' => '', |
39 | 'content_type' => '', | 39 | 'headers' => [ |
40 | 'content-type' => '', | ||
41 | ], | ||
40 | 'language' => '', | 42 | 'language' => '', |
41 | ]); | 43 | ]); |
42 | 44 | ||
@@ -71,7 +73,9 @@ class ContentProxyTest extends TestCase | |||
71 | 'html' => false, | 73 | 'html' => false, |
72 | 'title' => '', | 74 | 'title' => '', |
73 | 'url' => '', | 75 | 'url' => '', |
74 | 'content_type' => '', | 76 | 'headers' => [ |
77 | 'content-type' => '', | ||
78 | ], | ||
75 | 'language' => '', | 79 | 'language' => '', |
76 | ]); | 80 | ]); |
77 | 81 | ||
@@ -106,7 +110,9 @@ class ContentProxyTest extends TestCase | |||
106 | 'html' => false, | 110 | 'html' => false, |
107 | 'title' => 'my title', | 111 | 'title' => 'my title', |
108 | 'url' => '', | 112 | 'url' => '', |
109 | 'content_type' => '', | 113 | 'headers' => [ |
114 | 'content-type' => '', | ||
115 | ], | ||
110 | 'language' => '', | 116 | 'language' => '', |
111 | 'status' => '', | 117 | 'status' => '', |
112 | 'description' => 'desc', | 118 | 'description' => 'desc', |
@@ -361,14 +367,13 @@ class ContentProxyTest extends TestCase | |||
361 | 'html' => str_repeat('this is my content', 325), | 367 | 'html' => str_repeat('this is my content', 325), |
362 | 'title' => 'this is my title', | 368 | 'title' => 'this is my title', |
363 | 'url' => 'http://1.1.1.1', | 369 | 'url' => 'http://1.1.1.1', |
364 | 'content_type' => 'text/html', | 370 | 'headers' => [ |
371 | 'content-type' => 'text/html', | ||
372 | ], | ||
365 | 'language' => 'fr', | 373 | 'language' => 'fr', |
366 | 'status' => '200', | 374 | 'status' => '200', |
367 | 'description' => 'OG desc', | 375 | 'description' => 'OG desc', |
368 | 'image' => 'https://', | 376 | 'image' => 'https://', |
369 | 'headers' => [ | ||
370 | 'content-type' => 'text/html', | ||
371 | ], | ||
372 | ]); | 377 | ]); |
373 | 378 | ||
374 | $proxy = new ContentProxy($graby, $tagger, $validator, $this->getLogger(), $this->fetchingErrorMessage); | 379 | $proxy = new ContentProxy($graby, $tagger, $validator, $this->getLogger(), $this->fetchingErrorMessage); |
@@ -641,7 +646,9 @@ class ContentProxyTest extends TestCase | |||
641 | 'html' => false, | 646 | 'html' => false, |
642 | 'title' => $actualTitle, | 647 | 'title' => $actualTitle, |
643 | 'url' => '', | 648 | 'url' => '', |
644 | 'content_type' => 'text/html', | 649 | 'headers' => [ |
650 | 'content-type' => 'text/html', | ||
651 | ], | ||
645 | 'language' => '', | 652 | 'language' => '', |
646 | ]); | 653 | ]); |
647 | 654 | ||
@@ -676,7 +683,9 @@ class ContentProxyTest extends TestCase | |||
676 | 'html' => false, | 683 | 'html' => false, |
677 | 'title' => $actualTitle, | 684 | 'title' => $actualTitle, |
678 | 'url' => '', | 685 | 'url' => '', |
679 | 'content_type' => 'text/html', | 686 | 'headers' => [ |
687 | 'content-type' => 'text/html', | ||
688 | ], | ||
680 | 'language' => '', | 689 | 'language' => '', |
681 | ]); | 690 | ]); |
682 | 691 | ||
@@ -710,7 +719,9 @@ class ContentProxyTest extends TestCase | |||
710 | 'html' => false, | 719 | 'html' => false, |
711 | 'title' => $actualTitle, | 720 | 'title' => $actualTitle, |
712 | 'url' => '', | 721 | 'url' => '', |
713 | 'content_type' => 'application/pdf', | 722 | 'headers' => [ |
723 | 'content-type' => 'application/pdf', | ||
724 | ], | ||
714 | 'language' => '', | 725 | 'language' => '', |
715 | ]); | 726 | ]); |
716 | 727 | ||
@@ -744,7 +755,9 @@ class ContentProxyTest extends TestCase | |||
744 | 'html' => false, | 755 | 'html' => false, |
745 | 'title' => $actualTitle, | 756 | 'title' => $actualTitle, |
746 | 'url' => '', | 757 | 'url' => '', |
747 | 'content_type' => 'application/pdf', | 758 | 'headers' => [ |
759 | 'content-type' => 'application/pdf', | ||
760 | ], | ||
748 | 'language' => '', | 761 | 'language' => '', |
749 | ]); | 762 | ]); |
750 | 763 | ||
@@ -778,7 +791,9 @@ class ContentProxyTest extends TestCase | |||
778 | 'html' => false, | 791 | 'html' => false, |
779 | 'title' => $actualTitle, | 792 | 'title' => $actualTitle, |
780 | 'url' => '', | 793 | 'url' => '', |
781 | 'content_type' => 'application/pdf', | 794 | 'headers' => [ |
795 | 'content-type' => 'application/pdf', | ||
796 | ], | ||
782 | 'language' => '', | 797 | 'language' => '', |
783 | ]); | 798 | ]); |
784 | 799 | ||
@@ -813,7 +828,9 @@ class ContentProxyTest extends TestCase | |||
813 | 'html' => false, | 828 | 'html' => false, |
814 | 'title' => $actualTitle, | 829 | 'title' => $actualTitle, |
815 | 'url' => '', | 830 | 'url' => '', |
816 | 'content_type' => 'application/pdf', | 831 | 'headers' => [ |
832 | 'content-type' => 'application/pdf', | ||
833 | ], | ||
817 | 'language' => '', | 834 | 'language' => '', |
818 | ]); | 835 | ]); |
819 | 836 | ||
@@ -943,7 +960,9 @@ class ContentProxyTest extends TestCase | |||
943 | 'html' => false, | 960 | 'html' => false, |
944 | 'title' => '', | 961 | 'title' => '', |
945 | 'url' => $content_url, | 962 | 'url' => $content_url, |
946 | 'content_type' => '', | 963 | 'headers' => [ |
964 | 'content-type' => '', | ||
965 | ], | ||
947 | 'language' => '', | 966 | 'language' => '', |
948 | ], | 967 | ], |
949 | true | 968 | true |
@@ -974,7 +993,9 @@ class ContentProxyTest extends TestCase | |||
974 | } | 993 | } |
975 | 994 | ||
976 | /** | 995 | /** |
977 | * https://stackoverflow.com/a/18506801. | 996 | * Convert hex to string. |
997 | * | ||
998 | * @see https://stackoverflow.com/a/18506801 | ||
978 | * | 999 | * |
979 | * @param $hex | 1000 | * @param $hex |
980 | * | 1001 | * |