From 76b1dee499771c1b5327b4b7792e98fd41049096 Mon Sep 17 00:00:00 2001 From: Bjoern Schiessle Date: Wed, 2 Nov 2016 10:44:55 +0100 Subject: use https by default if no protocol is given. Only use unsecure connection if it is explicitely given Signed-off-by: Bjoern Schiessle --- .../tests/AddressHandlerTest.php | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'apps/federatedfilesharing/tests/AddressHandlerTest.php') 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 @@ -177,6 +177,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 * -- cgit v1.2.3