aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag
diff options
context:
space:
mode:
Diffstat (limited to 'tests/Wallabag')
-rw-r--r--tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php3
-rw-r--r--tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php26
2 files changed, 16 insertions, 13 deletions
diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
index 6e806553..2a2fd1a4 100644
--- a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
+++ b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
@@ -137,6 +137,8 @@ class EntryControllerTest extends WallabagCoreTestCase
137 $this->logInAs('admin'); 137 $this->logInAs('admin');
138 $client = $this->getClient(); 138 $client = $this->getClient();
139 139
140 $client->getContainer()->get('craue_config')->set('store_article_headers', 1);
141
140 $crawler = $client->request('GET', '/new'); 142 $crawler = $client->request('GET', '/new');
141 143
142 $this->assertSame(200, $client->getResponse()->getStatusCode()); 144 $this->assertSame(200, $client->getResponse()->getStatusCode());
@@ -165,6 +167,7 @@ class EntryControllerTest extends WallabagCoreTestCase
165 $this->assertSame('2015-03-28 11:43:19', $content->getPublishedAt()->format('Y-m-d H:i:s')); 167 $this->assertSame('2015-03-28 11:43:19', $content->getPublishedAt()->format('Y-m-d H:i:s'));
166 $this->assertSame('Morgane Tual', $author[0]); 168 $this->assertSame('Morgane Tual', $author[0]);
167 $this->assertArrayHasKey('x-varnish1', $content->getHeaders()); 169 $this->assertArrayHasKey('x-varnish1', $content->getHeaders());
170 $client->getContainer()->get('craue_config')->set('store_article_headers', 0);
168 } 171 }
169 172
170 public function testPostWithMultipleAuthors() 173 public function testPostWithMultipleAuthors()
diff --git a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
index f94c2137..2aac8c07 100644
--- a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
+++ b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
@@ -40,7 +40,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
40 'language' => '', 40 'language' => '',
41 ]); 41 ]);
42 42
43 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage); 43 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage, false);
44 $entry = new Entry(new User()); 44 $entry = new Entry(new User());
45 $proxy->updateEntry($entry, 'http://user@:80'); 45 $proxy->updateEntry($entry, 'http://user@:80');
46 46
@@ -75,7 +75,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
75 'language' => '', 75 'language' => '',
76 ]); 76 ]);
77 77
78 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage); 78 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage, false);
79 $entry = new Entry(new User()); 79 $entry = new Entry(new User());
80 $proxy->updateEntry($entry, 'http://0.0.0.0'); 80 $proxy->updateEntry($entry, 'http://0.0.0.0');
81 81
@@ -115,7 +115,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
115 ], 115 ],
116 ]); 116 ]);
117 117
118 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage); 118 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage, false);
119 $entry = new Entry(new User()); 119 $entry = new Entry(new User());
120 $proxy->updateEntry($entry, 'http://domain.io'); 120 $proxy->updateEntry($entry, 'http://domain.io');
121 121
@@ -157,7 +157,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
157 ], 157 ],
158 ]); 158 ]);
159 159
160 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage); 160 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage, false);
161 $entry = new Entry(new User()); 161 $entry = new Entry(new User());
162 $proxy->updateEntry($entry, 'http://0.0.0.0'); 162 $proxy->updateEntry($entry, 'http://0.0.0.0');
163 163
@@ -199,7 +199,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
199 ], 199 ],
200 ]); 200 ]);
201 201
202 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage); 202 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage, false);
203 $entry = new Entry(new User()); 203 $entry = new Entry(new User());
204 $proxy->updateEntry($entry, 'http://0.0.0.0'); 204 $proxy->updateEntry($entry, 'http://0.0.0.0');
205 205
@@ -241,7 +241,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
241 'status' => '200', 241 'status' => '200',
242 ]); 242 ]);
243 243
244 $proxy = new ContentProxy($graby, $tagger, $validator, $this->getLogger(), $this->fetchingErrorMessage); 244 $proxy = new ContentProxy($graby, $tagger, $validator, $this->getLogger(), $this->fetchingErrorMessage, false);
245 $entry = new Entry(new User()); 245 $entry = new Entry(new User());
246 $proxy->updateEntry($entry, 'http://0.0.0.0'); 246 $proxy->updateEntry($entry, 'http://0.0.0.0');
247 247
@@ -290,7 +290,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
290 ], 290 ],
291 ]); 291 ]);
292 292
293 $proxy = new ContentProxy($graby, $tagger, $validator, $this->getLogger(), $this->fetchingErrorMessage); 293 $proxy = new ContentProxy($graby, $tagger, $validator, $this->getLogger(), $this->fetchingErrorMessage, false);
294 $entry = new Entry(new User()); 294 $entry = new Entry(new User());
295 $proxy->updateEntry($entry, 'http://0.0.0.0'); 295 $proxy->updateEntry($entry, 'http://0.0.0.0');
296 296
@@ -311,7 +311,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
311 $tagger->expects($this->once()) 311 $tagger->expects($this->once())
312 ->method('tag'); 312 ->method('tag');
313 313
314 $proxy = new ContentProxy((new Graby()), $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage); 314 $proxy = new ContentProxy((new Graby()), $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage, false);
315 $entry = new Entry(new User()); 315 $entry = new Entry(new User());
316 $proxy->updateEntry( 316 $proxy->updateEntry(
317 $entry, 317 $entry,
@@ -353,7 +353,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
353 $logHandler = new TestHandler(); 353 $logHandler = new TestHandler();
354 $logger = new Logger('test', [$logHandler]); 354 $logger = new Logger('test', [$logHandler]);
355 355
356 $proxy = new ContentProxy((new Graby()), $tagger, $this->getValidator(), $logger, $this->fetchingErrorMessage); 356 $proxy = new ContentProxy((new Graby()), $tagger, $this->getValidator(), $logger, $this->fetchingErrorMessage, false);
357 $entry = new Entry(new User()); 357 $entry = new Entry(new User());
358 $proxy->updateEntry( 358 $proxy->updateEntry(
359 $entry, 359 $entry,
@@ -388,7 +388,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
388 $handler = new TestHandler(); 388 $handler = new TestHandler();
389 $logger->pushHandler($handler); 389 $logger->pushHandler($handler);
390 390
391 $proxy = new ContentProxy((new Graby()), $tagger, $this->getValidator(), $logger, $this->fetchingErrorMessage); 391 $proxy = new ContentProxy((new Graby()), $tagger, $this->getValidator(), $logger, $this->fetchingErrorMessage, false);
392 $entry = new Entry(new User()); 392 $entry = new Entry(new User());
393 $proxy->updateEntry( 393 $proxy->updateEntry(
394 $entry, 394 $entry,
@@ -425,7 +425,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
425 ->method('tag') 425 ->method('tag')
426 ->will($this->throwException(new \Exception())); 426 ->will($this->throwException(new \Exception()));
427 427
428 $proxy = new ContentProxy((new Graby()), $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage); 428 $proxy = new ContentProxy((new Graby()), $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage, false);
429 $entry = new Entry(new User()); 429 $entry = new Entry(new User());
430 $proxy->updateEntry( 430 $proxy->updateEntry(
431 $entry, 431 $entry,
@@ -465,7 +465,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
465 $tagger->expects($this->once()) 465 $tagger->expects($this->once())
466 ->method('tag'); 466 ->method('tag');
467 467
468 $proxy = new ContentProxy((new Graby()), $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage); 468 $proxy = new ContentProxy((new Graby()), $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage, false);
469 $entry = new Entry(new User()); 469 $entry = new Entry(new User());
470 $proxy->updateEntry( 470 $proxy->updateEntry(
471 $entry, 471 $entry,
@@ -517,7 +517,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
517 'open_graph' => [], 517 'open_graph' => [],
518 ]); 518 ]);
519 519
520 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage); 520 $proxy = new ContentProxy($graby, $tagger, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage, false);
521 $entry = new Entry(new User()); 521 $entry = new Entry(new User());
522 $proxy->updateEntry($entry, 'http://0.0.0.0'); 522 $proxy->updateEntry($entry, 'http://0.0.0.0');
523 523