summaryrefslogtreecommitdiffstats
path: root/apps/federatedfilesharing/tests/AddressHandlerTest.php
diff options
context:
space:
mode:
authorBjoern Schiessle <bjoern@schiessle.org>2016-11-02 10:44:55 +0100
committerBjoern Schiessle <bjoern@schiessle.org>2016-11-02 10:44:55 +0100
commit76b1dee499771c1b5327b4b7792e98fd41049096 (patch)
tree8a69cabd032979139c1ed8d6d95972b99fbfe4f7 /apps/federatedfilesharing/tests/AddressHandlerTest.php
parent42b0a0d2afe95b974545436e112a1d97edaeeb1a (diff)
downloadnextcloud-server-76b1dee499771c1b5327b4b7792e98fd41049096.tar.gz
nextcloud-server-76b1dee499771c1b5327b4b7792e98fd41049096.zip
use https by default if no protocol is given. Only use unsecure connection if it is explicitely given
Signed-off-by: Bjoern Schiessle <bjoern@schiessle.org>
Diffstat (limited to 'apps/federatedfilesharing/tests/AddressHandlerTest.php')
-rw-r--r--apps/federatedfilesharing/tests/AddressHandlerTest.php20
1 files changed, 20 insertions, 0 deletions
diff --git a/apps/federatedfilesharing/tests/AddressHandlerTest.php b/apps/federatedfilesharing/tests/AddressHandlerTest.php
index c2e69fb2bd7..f62f3b62e03 100644
--- a/apps/federatedfilesharing/tests/AddressHandlerTest.php
+++ b/apps/federatedfilesharing/tests/AddressHandlerTest.php
@@ -178,6 +178,26 @@ class AddressHandlerTest extends \Test\TestCase {
}
/**
+ * @dataProvider dataTestUrlContainProtocol
+ *
+ * @param string $url
+ * @param bool $expectedResult
+ */
+ public function testUrlContainProtocol($url, $expectedResult) {
+ $result = $this->addressHandler->urlContainProtocol($url);
+ $this->assertSame($expectedResult, $result);
+ }
+
+ public function dataTestUrlContainProtocol() {
+ return [
+ ['http://nextcloud.com', true],
+ ['https://nextcloud.com', true],
+ ['nextcloud.com', false],
+ ['httpserver.com', false],
+ ];
+ }
+
+ /**
* @dataProvider dataTestFixRemoteUrl
*
* @param string $url