diff options
author | Julius Härtl <jus@bitgrid.net> | 2019-12-02 10:48:41 +0100 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2019-12-07 09:53:06 +0100 |
commit | d05f131929b8812cac1c1e08bf8098d6df03b191 (patch) | |
tree | 130b90dd57776b587efccb767413e8fec21a7cc3 /tests | |
parent | 2959487f71c8226036ac3614bce27e3bbe60418a (diff) | |
download | nextcloud-server-d05f131929b8812cac1c1e08bf8098d6df03b191.tar.gz nextcloud-server-d05f131929b8812cac1c1e08bf8098d6df03b191.zip |
Move overwritehost check to isTrustedDomain
Signed-off-by: Julius Härtl <jus@bitgrid.net>
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')); + } } |