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
path: root/tests
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2019-12-02 12:48:41 +0300
committerBackportbot <backportbot-noreply@rullzer.com>2019-12-09 23:39:00 +0300
commit419df66251784ec63ac50fcc15165cd0f2a2e307 (patch)
treef6c705db3ceb017e3d66c096d8929171bc8f9124 /tests
parent9d8c0c262b2202ee581f39e9cc6dae48777a9491 (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.php17
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'));
+ }
}