aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php70
1 files changed, 37 insertions, 33 deletions
diff --git a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
index c7caac1d..40a6cc80 100644
--- a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
+++ b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
@@ -104,15 +104,12 @@ class ContentProxyTest extends TestCase
104 ->method('fetchContent') 104 ->method('fetchContent')
105 ->willReturn([ 105 ->willReturn([
106 'html' => false, 106 'html' => false,
107 'title' => '', 107 'title' => 'my title',
108 'url' => '', 108 'url' => '',
109 'content_type' => '', 109 'content_type' => '',
110 'language' => '', 110 'language' => '',
111 'status' => '', 111 'status' => '',
112 'open_graph' => [ 112 'description' => 'desc',
113 'og_title' => 'my title',
114 'og_description' => 'desc',
115 ],
116 ]); 113 ]);
117 114
118 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage); 115 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage);
@@ -147,13 +144,12 @@ class ContentProxyTest extends TestCase
147 'html' => str_repeat('this is my content', 325), 144 'html' => str_repeat('this is my content', 325),
148 'title' => 'this is my title', 145 'title' => 'this is my title',
149 'url' => 'http://1.1.1.1', 146 'url' => 'http://1.1.1.1',
150 'content_type' => 'text/html',
151 'language' => 'fr', 147 'language' => 'fr',
152 'status' => '200', 148 'status' => '200',
153 'open_graph' => [ 149 'description' => 'OG desc',
154 'og_title' => 'my OG title', 150 'image' => 'http://3.3.3.3/cover.jpg',
155 'og_description' => 'OG desc', 151 'headers' => [
156 'og_image' => 'http://3.3.3.3/cover.jpg', 152 'content-type' => 'text/html',
157 ], 153 ],
158 ]); 154 ]);
159 155
@@ -189,13 +185,12 @@ class ContentProxyTest extends TestCase
189 'html' => str_repeat('this is my content', 325), 185 'html' => str_repeat('this is my content', 325),
190 'title' => 'this is my title', 186 'title' => 'this is my title',
191 'url' => 'http://1.1.1.1', 187 'url' => 'http://1.1.1.1',
192 'content_type' => 'text/html',
193 'language' => 'fr', 188 'language' => 'fr',
194 'status' => '200', 189 'status' => '200',
195 'open_graph' => [ 190 'description' => 'OG desc',
196 'og_title' => 'my OG title', 191 'image' => null,
197 'og_description' => 'OG desc', 192 'headers' => [
198 'og_image' => null, 193 'content-type' => 'text/html',
199 ], 194 ],
200 ]); 195 ]);
201 196
@@ -320,9 +315,11 @@ class ContentProxyTest extends TestCase
320 'html' => str_repeat('this is my content', 325), 315 'html' => str_repeat('this is my content', 325),
321 'title' => 'this is my title', 316 'title' => 'this is my title',
322 'url' => 'http://1.1.1.1', 317 'url' => 'http://1.1.1.1',
323 'content_type' => 'text/html',
324 'language' => 'dontexist', 318 'language' => 'dontexist',
325 'status' => '200', 319 'status' => '200',
320 'headers' => [
321 'content-type' => 'text/html',
322 ],
326 ]); 323 ]);
327 324
328 $proxy = new ContentProxy($graby, $tagger, $validator, $this->getLogger(), $this->fetchingErrorMessage); 325 $proxy = new ContentProxy($graby, $tagger, $validator, $this->getLogger(), $this->fetchingErrorMessage);
@@ -367,10 +364,10 @@ class ContentProxyTest extends TestCase
367 'content_type' => 'text/html', 364 'content_type' => 'text/html',
368 'language' => 'fr', 365 'language' => 'fr',
369 'status' => '200', 366 'status' => '200',
370 'open_graph' => [ 367 'description' => 'OG desc',
371 'og_title' => 'my OG title', 368 'image' => 'https://',
372 'og_description' => 'OG desc', 369 'headers' => [
373 'og_image' => 'https://', 370 'content-type' => 'text/html',
374 ], 371 ],
375 ]); 372 ]);
376 373
@@ -404,12 +401,12 @@ class ContentProxyTest extends TestCase
404 'html' => str_repeat('this is my content', 325), 401 'html' => str_repeat('this is my content', 325),
405 'title' => 'this is my title', 402 'title' => 'this is my title',
406 'url' => 'http://1.1.1.1', 403 'url' => 'http://1.1.1.1',
407 'content_type' => 'text/html',
408 'language' => 'fr', 404 'language' => 'fr',
409 'date' => '1395635872', 405 'date' => '1395635872',
410 'authors' => ['Jeremy', 'Nico', 'Thomas'], 406 'authors' => ['Jeremy', 'Nico', 'Thomas'],
411 'all_headers' => [ 407 'headers' => [
412 'Cache-Control' => 'no-cache', 408 'cache-control' => 'no-cache',
409 'content-type' => 'text/html',
413 ], 410 ],
414 ] 411 ]
415 ); 412 );
@@ -447,9 +444,11 @@ class ContentProxyTest extends TestCase
447 'html' => str_repeat('this is my content', 325), 444 'html' => str_repeat('this is my content', 325),
448 'title' => 'this is my title', 445 'title' => 'this is my title',
449 'url' => 'http://1.1.1.1', 446 'url' => 'http://1.1.1.1',
450 'content_type' => 'text/html',
451 'language' => 'fr', 447 'language' => 'fr',
452 'date' => '2016-09-08T11:55:58+0200', 448 'date' => '2016-09-08T11:55:58+0200',
449 'headers' => [
450 'content-type' => 'text/html',
451 ],
453 ] 452 ]
454 ); 453 );
455 454
@@ -482,9 +481,11 @@ class ContentProxyTest extends TestCase
482 'html' => str_repeat('this is my content', 325), 481 'html' => str_repeat('this is my content', 325),
483 'title' => 'this is my title', 482 'title' => 'this is my title',
484 'url' => 'http://1.1.1.1', 483 'url' => 'http://1.1.1.1',
485 'content_type' => 'text/html',
486 'language' => 'fr', 484 'language' => 'fr',
487 'date' => '01 02 2012', 485 'date' => '01 02 2012',
486 'headers' => [
487 'content-type' => 'text/html',
488 ],
488 ] 489 ]
489 ); 490 );
490 491
@@ -519,8 +520,10 @@ class ContentProxyTest extends TestCase
519 'html' => str_repeat('this is my content', 325), 520 'html' => str_repeat('this is my content', 325),
520 'title' => 'this is my title', 521 'title' => 'this is my title',
521 'url' => 'http://1.1.1.1', 522 'url' => 'http://1.1.1.1',
522 'content_type' => 'text/html',
523 'language' => 'fr', 523 'language' => 'fr',
524 'headers' => [
525 'content-type' => 'text/html',
526 ],
524 ] 527 ]
525 ); 528 );
526 529
@@ -559,13 +562,13 @@ class ContentProxyTest extends TestCase
559 'html' => $html, 562 'html' => $html,
560 'title' => 'this is my title', 563 'title' => 'this is my title',
561 'url' => 'http://1.1.1.1', 564 'url' => 'http://1.1.1.1',
562 'content_type' => 'text/html',
563 'language' => 'fr', 565 'language' => 'fr',
564 'status' => '200', 566 'status' => '200',
565 'open_graph' => [ 567 //'og_title' => 'my OG title',
566 'og_title' => 'my OG title', 568 'description' => 'OG desc',
567 'og_description' => 'OG desc', 569 'image' => 'http://3.3.3.3/cover.jpg',
568 'og_image' => 'http://3.3.3.3/cover.jpg', 570 'headers' => [
571 'content-type' => 'text/html',
569 ], 572 ],
570 ] 573 ]
571 ); 574 );
@@ -597,9 +600,10 @@ class ContentProxyTest extends TestCase
597 'html' => '<p><img src="http://1.1.1.1/image.jpg" /></p>', 600 'html' => '<p><img src="http://1.1.1.1/image.jpg" /></p>',
598 'title' => 'this is my title', 601 'title' => 'this is my title',
599 'url' => 'http://1.1.1.1/image.jpg', 602 'url' => 'http://1.1.1.1/image.jpg',
600 'content_type' => 'image/jpeg',
601 'status' => '200', 603 'status' => '200',
602 'open_graph' => [], 604 'headers' => [
605 'content-type' => 'image/jpeg',
606 ],
603 ]); 607 ]);
604 608
605 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage); 609 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage);