aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2014-12-05 11:27:20 +0100
committerMorris Jobke <hey@morrisjobke.de>2014-12-05 11:27:20 +0100
commit4ec1da3014b1aecd2fa06575a69cd3c053eaba1a (patch)
treeedeebfc2e533cbf433955e056a117e50ad80b2e8 /tests
parente81c2a49d10372b2709b20a0ecfdc7835297170f (diff)
parent81541c56b6e489c14287e99cff239a89d9553e49 (diff)
downloadnextcloud-server-4ec1da3014b1aecd2fa06575a69cd3c053eaba1a.tar.gz
nextcloud-server-4ec1da3014b1aecd2fa06575a69cd3c053eaba1a.zip
Merge pull request #12583 from owncloud/trim-port
Trim port from domain
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/request.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/lib/request.php b/tests/lib/request.php
index 254048723e7..ea3722b90a6 100644
--- a/tests/lib/request.php
+++ b/tests/lib/request.php
@@ -228,6 +228,23 @@ class Test_Request extends \Test\TestCase {
OC_Config::deleteKey('overwritehost');
}
+ public function hostWithPortProvider() {
+ return array(
+ array('localhost:500', 'localhost'),
+ array('foo.com', 'foo.com'),
+ array('[1fff:0:a88:85a3::ac1f]:801', '[1fff:0:a88:85a3::ac1f]'),
+ array('[1fff:0:a88:85a3::ac1f]', '[1fff:0:a88:85a3::ac1f]')
+ );
+ }
+
+ /**
+ * @dataProvider hostWithPortProvider
+ */
+ public function testGetDomainWithoutPort($hostWithPort, $host) {
+ $this->assertEquals($host, OC_Request::getDomainWithoutPort($hostWithPort));
+
+ }
+
/**
* @dataProvider trustedDomainDataProvider
*/