1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- <?php
- /**
- * SPDX-FileCopyrightText: 2019-2024 Nextcloud GmbH and Nextcloud contributors
- * SPDX-FileCopyrightText: 2016 ownCloud, Inc.
- * SPDX-License-Identifier: AGPL-3.0-only
- */
- namespace OCA\Files_External\Tests;
- /**
- * Class OwnCloudFunctions
- *
- * @group DB
- *
- * @package OCA\Files_External\Tests
- */
- class OwnCloudFunctionsTest extends \Test\TestCase {
- public function configUrlProvider() {
- return [
- [
- [
- 'host' => 'testhost',
- 'root' => 'testroot',
- 'secure' => false
- ],
- 'http://testhost/remote.php/webdav/testroot/',
- ],
- [
- [
- 'host' => 'testhost',
- 'root' => 'testroot',
- 'secure' => true
- ],
- 'https://testhost/remote.php/webdav/testroot/',
- ],
- [
- [
- 'host' => 'http://testhost',
- 'root' => 'testroot',
- 'secure' => false
- ],
- 'http://testhost/remote.php/webdav/testroot/',
- ],
- [
- [
- 'host' => 'https://testhost',
- 'root' => 'testroot',
- 'secure' => false
- ],
- 'https://testhost/remote.php/webdav/testroot/',
- ],
- [
- [
- 'host' => 'https://testhost/testroot',
- 'root' => '',
- 'secure' => false
- ],
- 'https://testhost/testroot/remote.php/webdav/',
- ],
- [
- [
- 'host' => 'https://testhost/testroot',
- 'root' => 'subdir',
- 'secure' => false
- ],
- 'https://testhost/testroot/remote.php/webdav/subdir/',
- ],
- [
- [
- 'host' => 'http://testhost/testroot',
- 'root' => 'subdir',
- 'secure' => true
- ],
- 'http://testhost/testroot/remote.php/webdav/subdir/',
- ],
- [
- [
- 'host' => 'http://testhost/testroot/',
- 'root' => '/subdir',
- 'secure' => false
- ],
- 'http://testhost/testroot/remote.php/webdav/subdir/',
- ],
- ];
- }
- /**
- * @dataProvider configUrlProvider
- */
- public function testConfig($config, $expectedUri): void {
- $config['user'] = 'someuser';
- $config['password'] = 'somepassword';
- $instance = new \OCA\Files_External\Lib\Storage\OwnCloud($config);
- $this->assertEquals($expectedUri, $instance->createBaseUri());
- }
- }
|