aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag/CoreBundle
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2017-11-21 13:26:24 +0100
committerGitHub <noreply@github.com>2017-11-21 13:26:24 +0100
commit95b7d92ea5f92078c2e1fed0b346a9722de762c4 (patch)
tree3e9ed92170e9e63b592ef47abfd4c05f6374b76a /tests/Wallabag/CoreBundle
parentfb258aeef0a28ce9aaebac8f337b9970bd99e70d (diff)
parent709e21a3f4ef3616112a02be06045a1e3ab63a01 (diff)
downloadwallabag-95b7d92ea5f92078c2e1fed0b346a9722de762c4.tar.gz
wallabag-95b7d92ea5f92078c2e1fed0b346a9722de762c4.tar.zst
wallabag-95b7d92ea5f92078c2e1fed0b346a9722de762c4.zip
Merge pull request #3425 from wallabag/add-setting-for-headers
Added internal setting to enable/disable headers storage
Diffstat (limited to 'tests/Wallabag/CoreBundle')
-rw-r--r--tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php3
-rw-r--r--tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php3
2 files changed, 5 insertions, 1 deletions
diff --git a/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php b/tests/Wallabag/CoreBundle/Controller/EntryControllerTest.php
index c6a523e3..4ac4548b 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 0731a0c0..5c99e461 100644
--- a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
+++ b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php
@@ -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, true);
315 $entry = new Entry(new User()); 315 $entry = new Entry(new User());
316 $proxy->updateEntry( 316 $proxy->updateEntry(
317 $entry, 317 $entry,
@@ -341,6 +341,7 @@ class ContentProxyTest extends \PHPUnit_Framework_TestCase
341 $this->assertContains('Jeremy', $entry->getPublishedBy()); 341 $this->assertContains('Jeremy', $entry->getPublishedBy());
342 $this->assertContains('Nico', $entry->getPublishedBy()); 342 $this->assertContains('Nico', $entry->getPublishedBy());
343 $this->assertContains('Thomas', $entry->getPublishedBy()); 343 $this->assertContains('Thomas', $entry->getPublishedBy());
344 $this->assertNotNull($entry->getHeaders(), 'Headers are stored, so value is not null');
344 $this->assertContains('no-cache', $entry->getHeaders()); 345 $this->assertContains('no-cache', $entry->getHeaders());
345 } 346 }
346 347