Do not make setupMounts() public just because of testing
This commit is contained in:
parent
dcd2d7aff5
commit
6a677ce8fe
2 changed files with 12 additions and 12 deletions
2
apps/files_sharing/lib/external/manager.php
vendored
2
apps/files_sharing/lib/external/manager.php
vendored
|
@ -94,7 +94,7 @@ class Manager {
|
|||
}
|
||||
}
|
||||
|
||||
public function setupMounts() {
|
||||
private function setupMounts() {
|
||||
// don't setup server-to-server shares if the admin disabled it
|
||||
if (\OCA\Files_Sharing\Helper::isIncomingServer2serverShareEnabled() === false) {
|
||||
return false;
|
||||
|
|
22
apps/files_sharing/tests/external/manager.php
vendored
22
apps/files_sharing/tests/external/manager.php
vendored
|
@ -73,19 +73,19 @@ class Manager extends TestCase {
|
|||
|
||||
public function testAddBasic() {
|
||||
$this->instance->addShare('http://example.com', 'foo', 'bar', 'example', 'me', true);
|
||||
$this->instance->setupMounts();
|
||||
\Test_Helper::invokePrivate($this->instance, 'setupMounts');
|
||||
$this->assertMount('/example');
|
||||
}
|
||||
|
||||
public function testAddBasicEmptyPassword() {
|
||||
$this->instance->addShare('http://example.com', 'foo', '', 'example', 'me', true);
|
||||
$this->instance->setupMounts();
|
||||
\Test_Helper::invokePrivate($this->instance, 'setupMounts');
|
||||
$this->assertMount('/example');
|
||||
}
|
||||
|
||||
public function testAddNotAcceptedShare() {
|
||||
$this->instance->addShare('http://example.com', 'foo', 'bar', 'example', 'me', false);
|
||||
$this->instance->setupMounts();
|
||||
\Test_Helper::invokePrivate($this->instance, 'setupMounts');
|
||||
$this->assertNotMount('/example');
|
||||
}
|
||||
|
||||
|
@ -95,7 +95,7 @@ class Manager extends TestCase {
|
|||
$this->assertCount(1, $open);
|
||||
$this->instance->acceptShare($open[0]['id']);
|
||||
$this->assertEquals([], $this->instance->getOpenShares());
|
||||
$this->instance->setupMounts();
|
||||
\Test_Helper::invokePrivate($this->instance, 'setupMounts');
|
||||
$this->assertMount('/example');
|
||||
}
|
||||
|
||||
|
@ -105,38 +105,38 @@ class Manager extends TestCase {
|
|||
$this->assertCount(1, $open);
|
||||
$this->instance->declineShare($open[0]['id']);
|
||||
$this->assertEquals([], $this->instance->getOpenShares());
|
||||
$this->instance->setupMounts();
|
||||
\Test_Helper::invokePrivate($this->instance, 'setupMounts');
|
||||
$this->assertNotMount('/example');
|
||||
}
|
||||
|
||||
public function testSetMountPoint() {
|
||||
$this->instance->addShare('http://example.com', 'foo', 'bar', 'example', 'me', true);
|
||||
$this->instance->setupMounts();
|
||||
\Test_Helper::invokePrivate($this->instance, 'setupMounts');
|
||||
$this->assertMount('/example');
|
||||
$this->instance->setMountPoint($this->getFullPath('/example'), $this->getFullPath('/renamed'));
|
||||
$this->mountManager->clear();
|
||||
$this->instance->setupMounts();
|
||||
\Test_Helper::invokePrivate($this->instance, 'setupMounts');
|
||||
$this->assertMount('/renamed');
|
||||
$this->assertNotMount('/example');
|
||||
}
|
||||
|
||||
public function testRemoveShare() {
|
||||
$this->instance->addShare('http://example.com', 'foo', 'bar', 'example', 'me', true);
|
||||
$this->instance->setupMounts();
|
||||
\Test_Helper::invokePrivate($this->instance, 'setupMounts');
|
||||
$this->assertMount('/example');
|
||||
$this->instance->removeShare($this->getFullPath('/example'));
|
||||
$this->mountManager->clear();
|
||||
$this->instance->setupMounts();
|
||||
\Test_Helper::invokePrivate($this->instance, 'setupMounts');
|
||||
$this->assertNotMount('/example');
|
||||
}
|
||||
|
||||
public function testRemoveShareForUser() {
|
||||
$this->instance->addShare('http://example.com', 'foo', 'bar', 'example', 'me', true);
|
||||
$this->instance->setupMounts();
|
||||
\Test_Helper::invokePrivate($this->instance, 'setupMounts');
|
||||
$this->assertMount('/example');
|
||||
$this->instance->removeUserShares($this->uid);
|
||||
$this->mountManager->clear();
|
||||
$this->instance->setupMounts();
|
||||
\Test_Helper::invokePrivate($this->instance, 'setupMounts');
|
||||
$this->assertNotMount('/example');
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue