diff options
author | Julius Härtl <jus@bitgrid.net> | 2019-12-02 12:48:41 +0300 |
---|---|---|
committer | Backportbot <backportbot-noreply@rullzer.com> | 2019-12-09 23:40:33 +0300 |
commit | 42bb1391c5c223b24f7e395cb46ec4d16a68b0c4 (patch) | |
tree | 0856bf1bb177c2dd299086fed18c5e077489ad96 /tests | |
parent | 8e74b232edc17159435b52e96e545c2ad8486d39 (diff) |
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 25586a1bc27..973ff29e46f 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)); @@ -108,4 +112,15 @@ class TrustedDomainHelperTest extends \Test\TestCase { [$trustedHostTestList, 'bad..der.leading.host', false], ]; } + + 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')); + } } |