aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/Wallabag
diff options
context:
space:
mode:
authorJeremy Benoist <jeremy.benoist@gmail.com>2017-11-22 09:59:11 +0100
committerJeremy Benoist <jeremy.benoist@gmail.com>2017-11-22 10:00:45 +0100
commitef2b4041fb3791554e93b4180777adbfdcf9afa2 (patch)
treee48cb9b072e93179c6a79278ef949d9239a1d77d /tests/Wallabag
parent709e21a3f4ef3616112a02be06045a1e3ab63a01 (diff)
downloadwallabag-ef2b4041fb3791554e93b4180777adbfdcf9afa2.tar.gz
wallabag-ef2b4041fb3791554e93b4180777adbfdcf9afa2.tar.zst
wallabag-ef2b4041fb3791554e93b4180777adbfdcf9afa2.zip
Disable controller access if feature disabled
If `restricted_access` is disabled, accessing `/site-credentials/` must be disabled.
Diffstat (limited to 'tests/Wallabag')
-rw-r--r--tests/Wallabag/CoreBundle/Controller/SiteCredentialControllerTest.php14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/Wallabag/CoreBundle/Controller/SiteCredentialControllerTest.php b/tests/Wallabag/CoreBundle/Controller/SiteCredentialControllerTest.php
index 87ea2867..f5074403 100644
--- a/tests/Wallabag/CoreBundle/Controller/SiteCredentialControllerTest.php
+++ b/tests/Wallabag/CoreBundle/Controller/SiteCredentialControllerTest.php
@@ -8,6 +8,20 @@ use Wallabag\CoreBundle\Entity\SiteCredential;
8 8
9class SiteCredentialControllerTest extends WallabagCoreTestCase 9class SiteCredentialControllerTest extends WallabagCoreTestCase
10{ 10{
11 public function testAccessDeniedBecauseFeatureDisabled()
12 {
13 $this->logInAs('admin');
14 $client = $this->getClient();
15
16 $client->getContainer()->get('craue_config')->set('restricted_access', 0);
17
18 $client->request('GET', '/site-credentials/');
19
20 $this->assertSame(404, $client->getResponse()->getStatusCode());
21
22 $client->getContainer()->get('craue_config')->set('restricted_access', 1);
23 }
24
11 public function testListSiteCredential() 25 public function testListSiteCredential()
12 { 26 {
13 $this->logInAs('admin'); 27 $this->logInAs('admin');