diff options
author | Morris Jobke <hey@morrisjobke.de> | 2014-12-05 11:27:20 +0100 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2014-12-05 11:27:20 +0100 |
commit | 4ec1da3014b1aecd2fa06575a69cd3c053eaba1a (patch) | |
tree | edeebfc2e533cbf433955e056a117e50ad80b2e8 /tests | |
parent | e81c2a49d10372b2709b20a0ecfdc7835297170f (diff) | |
parent | 81541c56b6e489c14287e99cff239a89d9553e49 (diff) | |
download | nextcloud-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.php | 17 |
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 */ |