summaryrefslogtreecommitdiffstats
path: root/apps/federatedfilesharing/tests/AddressHandlerTest.php
diff options
context:
space:
mode:
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