diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2019-12-09 21:37:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-09 21:37:22 +0100 |
commit | 72155009faec02b000d8d320e3fba9d1ca51076b (patch) | |
tree | 1f10bceaaea089d5aa0b6255ec9f875b159bdb77 /tests | |
parent | 3e720942e58f99b038616d95e00a01ac9dd2f490 (diff) | |
parent | d05f131929b8812cac1c1e08bf8098d6df03b191 (diff) | |
download | nextcloud-server-72155009faec02b000d8d320e3fba9d1ca51076b.tar.gz nextcloud-server-72155009faec02b000d8d320e3fba9d1ca51076b.zip |
Merge pull request #18184 from nextcloud/bugfix/noid/is-trusted-domain
Move overwritehost check to isTrustedDomain
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Security/TrustedDomainHelperTest.php | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/tests/lib/Security/TrustedDomainHelperTest.php b/tests/lib/Security/TrustedDomainHelperTest.php index 26158401f79..f3ee14dead1 100644 --- a/tests/lib/Security/TrustedDomainHelperTest.php +++ b/tests/lib/Security/TrustedDomainHelperTest.php @@ -31,7 +31,11 @@ class TrustedDomainHelperTest extends \Test\TestCase { * @param bool $result */ public function testIsTrustedDomain($trustedDomains, $testDomain, $result) { - $this->config->expects($this->once()) + $this->config->expects($this->at(0)) + ->method('getSystemValue') + ->with('overwritehost') + ->will($this->returnValue('')); + $this->config->expects($this->at(1)) ->method('getSystemValue') ->with('trusted_domains') ->will($this->returnValue($trustedDomains)); @@ -113,4 +117,15 @@ class TrustedDomainHelperTest extends \Test\TestCase { [$trustedHostTestList, 'LOWERCASE.DOMAIN', true], ]; } + + public function testIsTrustedDomainOverwriteHost() { + $this->config->expects($this->at(0)) + ->method('getSystemValue') + ->with('overwritehost') + ->will($this->returnValue('myproxyhost')); + + $trustedDomainHelper = new TrustedDomainHelper($this->config); + $this->assertTrue($trustedDomainHelper->isTrustedDomain('myproxyhost')); + $this->assertTrue($trustedDomainHelper->isTrustedDomain('myotherhost')); + } } |