summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2017-09-13 14:39:04 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2017-09-26 23:10:25 +0200
commita7a651f4a44be00b7be777baf4adfa76a8490c9f (patch)
treee1c45ac804804342d4f82cfade4adb6296cb8359 /apps/files_sharing
parent3888b3a285734f8c3319689f5681dff3aa21f5e9 (diff)
downloadnextcloud-server-a7a651f4a44be00b7be777baf4adfa76a8490c9f.tar.gz
nextcloud-server-a7a651f4a44be00b7be777baf4adfa76a8490c9f.zip
move splitUserRemote unit tests
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/files_sharing')
-rw-r--r--apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php72
1 files changed, 0 insertions, 72 deletions
diff --git a/apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php b/apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php
index 85b4f5ae35d..80cc66afaac 100644
--- a/apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php
+++ b/apps/files_sharing/tests/Controller/ShareesAPIControllerTest.php
@@ -452,78 +452,6 @@ class ShareesAPIControllerTest extends TestCase {
}
/**
- * @dataProvider dataTestSplitUserRemote
- *
- * @param string $remote
- * @param string $expectedUser
- * @param string $expectedUrl
- */
- public function testSplitUserRemote($remote, $expectedUser, $expectedUrl) {
- list($remoteUser, $remoteUrl) = $this->sharees->splitUserRemote($remote);
- $this->assertSame($expectedUser, $remoteUser);
- $this->assertSame($expectedUrl, $remoteUrl);
- }
-
- public function dataTestSplitUserRemote() {
- $userPrefix = ['user@name', 'username'];
- $protocols = ['', 'http://', 'https://'];
- $remotes = [
- 'localhost',
- 'local.host',
- 'dev.local.host',
- 'dev.local.host/path',
- 'dev.local.host/at@inpath',
- '127.0.0.1',
- '::1',
- '::192.0.2.128',
- '::192.0.2.128/at@inpath',
- ];
-
- $testCases = [];
- foreach ($userPrefix as $user) {
- foreach ($remotes as $remote) {
- foreach ($protocols as $protocol) {
- $baseUrl = $user . '@' . $protocol . $remote;
-
- $testCases[] = [$baseUrl, $user, $protocol . $remote];
- $testCases[] = [$baseUrl . '/', $user, $protocol . $remote];
- $testCases[] = [$baseUrl . '/index.php', $user, $protocol . $remote];
- $testCases[] = [$baseUrl . '/index.php/s/token', $user, $protocol . $remote];
- }
- }
- }
- return $testCases;
- }
-
- public function dataTestSplitUserRemoteError() {
- return array(
- // Invalid path
- array('user@'),
-
- // Invalid user
- array('@server'),
- array('us/er@server'),
- array('us:er@server'),
-
- // Invalid splitting
- array('user'),
- array(''),
- array('us/erserver'),
- array('us:erserver'),
- );
- }
-
- /**
- * @dataProvider dataTestSplitUserRemoteError
- *
- * @param string $id
- * @expectedException \Exception
- */
- public function testSplitUserRemoteError($id) {
- $this->sharees->splitUserRemote($id);
- }
-
- /**
* @dataProvider dataTestFixRemoteUrl
*
* @param string $url