Browse Source

removes invalid tests, adapts another one

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
tags/v13.0.0beta4
Arthur Schiwon 6 years ago
parent
commit
e9eccf34f9
No account linked to committer's email address
2 changed files with 3 additions and 37 deletions
  1. 3
    4
      apps/user_ldap/tests/User_LDAPTest.php
  2. 0
    33
      tests/lib/Files/FilesystemTest.php

+ 3
- 4
apps/user_ldap/tests/User_LDAPTest.php View File

@@ -1343,10 +1343,6 @@ class User_LDAPTest extends TestCase {
}
return true;
}));

$access->userManager->expects($this->atLeastOnce())
->method('get')
->willReturn($this->createMock(User::class));
}

/**
@@ -1357,6 +1353,9 @@ class User_LDAPTest extends TestCase {
$access = $this->getAccessMock();

$this->prepareAccessForSetPassword($access);
$access->userManager->expects($this->atLeastOnce())
->method('get')
->willReturn($this->createMock(User::class));
$backend = new UserLDAP($access, $this->createMock(IConfig::class), $this->createMock(INotificationManager::class), $this->createMock(Session::class), $this->getDefaultPluginManagerMock());
\OC_User::useBackend($backend);


+ 0
- 33
tests/lib/Files/FilesystemTest.php View File

@@ -368,39 +368,6 @@ class FilesystemTest extends \Test\TestCase {
$this->assertEquals(2, $thrown);
}

public function testUserNameCasing() {
$this->logout();
$userId = $this->getUniqueID('user_');

\OC_User::clearBackends();
// needed for loginName2UserName mapping
$userBackend = $this->createMock(\OC\User\Database::class);
\OC::$server->getUserManager()->registerBackend($userBackend);

$userBackend->expects($this->once())
->method('userExists')
->with(strtoupper($userId))
->will($this->returnValue(true));
$userBackend->expects($this->once())
->method('loginName2UserName')
->with(strtoupper($userId))
->will($this->returnValue($userId));

$view = new \OC\Files\View();
$this->assertFalse($view->file_exists('/' . $userId));

\OC\Files\Filesystem::initMountPoints(strtoupper($userId));

list($storage1, $path1) = $view->resolvePath('/' . $userId);
list($storage2, $path2) = $view->resolvePath('/' . strtoupper($userId));

$this->assertTrue($storage1->instanceOfStorage('\OCP\Files\IHomeStorage'));
$this->assertEquals('', $path1);

// not mounted, still on the local root storage
$this->assertEquals(strtoupper($userId), $path2);
}

/**
* Tests that the home storage is used for the user's mount point
*/

Loading…
Cancel
Save