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:39:00 +0300 |
commit | 419df66251784ec63ac50fcc15165cd0f2a2e307 (patch) | |
tree | f6c705db3ceb017e3d66c096d8929171bc8f9124 /tests | |
parent | 9d8c0c262b2202ee581f39e9cc6dae48777a9491 (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')); + } } |