Merge pull request #22309 from owncloud/infinite-recursion-on-expired-link

Do not getShare in deleteShare, it's already there when deleting
This commit is contained in:
Thomas Müller 2016-02-12 11:11:26 +01:00
commit 207c09c511
2 changed files with 4 additions and 14 deletions

View File

@ -718,9 +718,9 @@ class Manager implements IManager {
* @throws \InvalidArgumentException
*/
public function deleteShare(\OCP\Share\IShare $share) {
// Just to make sure we have all the info
try {
$share = $this->getShareById($share->getFullId());
$share->getFullId();
} catch (\UnexpectedValueException $e) {
throw new \InvalidArgumentException('Share does not have a full id');
}

View File

@ -132,16 +132,10 @@ class ManagerTest extends \Test\TestCase {
}
/**
* @expectedException \OCP\Share\Exceptions\ShareNotFound
* @expectedException \InvalidArgumentException
*/
public function testDeleteNoShareId() {
$share = $this->getMock('\OCP\Share\IShare');
$share
->expects($this->once())
->method('getFullId')
->with()
->willReturn(null);
$share = $this->manager->newShare();
$this->manager->deleteShare($share);
}
@ -181,7 +175,6 @@ class ManagerTest extends \Test\TestCase {
->setNode($path)
->setTarget('myTarget');
$manager->expects($this->once())->method('getShareById')->with('prov:42')->willReturn($share);
$manager->expects($this->once())->method('deleteChildren')->with($share);
$this->defaultProvider
@ -261,7 +254,6 @@ class ManagerTest extends \Test\TestCase {
$this->rootFolder->expects($this->never())->method($this->anything());
$manager->expects($this->once())->method('getShareById')->with('prov:42')->willReturn($share);
$manager->expects($this->once())->method('deleteChildren')->with($share);
$this->defaultProvider
@ -359,8 +351,6 @@ class ManagerTest extends \Test\TestCase {
->setTarget('myTarget3')
->setParent(43);
$manager->expects($this->once())->method('getShareById')->with('prov:42')->willReturn($share1);
$this->defaultProvider
->method('getChildren')
->will($this->returnValueMap([