Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2019-12-02 12:48:41 +0300
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2019-12-07 11:53:06 +0300
commitd05f131929b8812cac1c1e08bf8098d6df03b191 (patch)
tree130b90dd57776b587efccb767413e8fec21a7cc3 /tests/lib/Security
parent2959487f71c8226036ac3614bce27e3bbe60418a (diff)
Move overwritehost check to isTrustedDomain
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'tests/lib/Security')
-rw-r--r--tests/lib/Security/TrustedDomainHelperTest.php17
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'));
+ }
}