$currentUser = $this->currentUser;
$this->shareManager->expects($this->once())->method('createShare')->with(
- $this->callback(function (IShare $share) use ($path, $currentUser) {
- return $share->getPath() === $path &&
+ $this->callback(function (\OCP\Share\IShare $share) use ($path, $currentUser) {
+ return $share->getNode() === $path &&
$share->getShareType() === \OCP\Share::SHARE_TYPE_LINK &&
$share->getPermissions() === \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_CREATE | \OCP\Constants::PERMISSION_DELETE &&
$share->getSharedBy() === $currentUser &&
$share->getPassword() === null &&
$share->getExpirationDate() === null;
})
- );
+ )->will($this->returnArgument(0));
$expected = new \OC_OCS_Result(null);
$result = $ocs->createShare();
$currentUser = $this->currentUser;
$this->shareManager->expects($this->once())->method('createShare')->with(
- $this->callback(function (IShare $share) use ($path, $currentUser) {
- return $share->getPath() === $path &&
+ $this->callback(function (\OCP\Share\IShare $share) use ($path, $currentUser) {
+ return $share->getNode() === $path &&
$share->getShareType() === \OCP\Share::SHARE_TYPE_LINK &&
$share->getPermissions() === \OCP\Constants::PERMISSION_READ &&
$share->getSharedBy() === $currentUser &&
$share->getPassword() === 'password' &&
$share->getExpirationDate() === null;
})
- );
+ )->will($this->returnArgument(0));
$expected = new \OC_OCS_Result(null);
$result = $ocs->createShare();
$currentUser = $this->currentUser;
$this->shareManager->expects($this->once())->method('createShare')->with(
- $this->callback(function (IShare $share) use ($path, $currentUser) {
+ $this->callback(function (\OCP\Share\IShare $share) use ($path, $currentUser) {
$date = new \DateTime('2000-01-01');
$date->setTime(0,0,0);
- return $share->getPath() === $path &&
+ return $share->getNode() === $path &&
$share->getShareType() === \OCP\Share::SHARE_TYPE_LINK &&
$share->getPermissions() === \OCP\Constants::PERMISSION_READ &&
$share->getSharedBy() === $currentUser &&
$share->getPassword() === null &&
$share->getExpirationDate() == $date;
})
- );
+ )->will($this->returnArgument(0));
$expected = new \OC_OCS_Result(null);
$result = $ocs->createShare();
$this->shareManager->method('getShareById')->with('ocinternal:42')->willReturn($share);
$this->shareManager->expects($this->once())->method('updateShare')->with(
- $this->callback(function (IShare $share) {
+ $this->callback(function (\OCP\Share\IShare $share) {
return $share->getPermissions() === \OCP\Constants::PERMISSION_READ &&
$share->getPassword() === null &&
$share->getExpirationDate() === null;
})
- );
+ )->will($this->returnArgument(0));
$expected = new \OC_OCS_Result(null);
$result = $ocs->updateShare(42);
$share->setPermissions(\OCP\Constants::PERMISSION_ALL)
->setSharedBy($this->currentUser)
->setShareType(\OCP\Share::SHARE_TYPE_LINK)
- ->setPath($folder);
+ ->setNode($folder);
$this->request
->method('getParam')
$this->shareManager->method('shareApiLinkAllowPublicUpload')->willReturn(true);
$this->shareManager->expects($this->once())->method('updateShare')->with(
- $this->callback(function (IShare $share) {
+ $this->callback(function (\OCP\Share\IShare $share) {
$date = new \DateTime('2000-01-01');
$date->setTime(0,0,0);
$share->getPassword() === 'password' &&
$share->getExpirationDate() == $date;
})
- );
+ )->will($this->returnArgument(0));
$expected = new \OC_OCS_Result(null);
$result = $ocs->updateShare(42);
$share->setPermissions(\OCP\Constants::PERMISSION_ALL)
->setSharedBy($this->currentUser)
->setShareType(\OCP\Share::SHARE_TYPE_LINK)
- ->setPath($folder);
+ ->setNode($folder);
$this->request
->method('getParam')
$share->setPermissions(\OCP\Constants::PERMISSION_ALL)
->setSharedBy($this->currentUser)
->setShareType(\OCP\Share::SHARE_TYPE_LINK)
- ->setPath($folder);
+ ->setNode($folder);
$this->request
->method('getParam')
$share->setPermissions(\OCP\Constants::PERMISSION_ALL)
->setSharedBy($this->currentUser)
->setShareType(\OCP\Share::SHARE_TYPE_LINK)
- ->setPath($file);
+ ->setNode($file);
$this->request
->method('getParam')
$this->shareManager->method('getShareById')->with('ocinternal:42')->willReturn($share);
$this->shareManager->expects($this->once())->method('updateShare')->with(
- $this->callback(function (IShare $share) use ($date) {
+ $this->callback(function (\OCP\Share\IShare $share) use ($date) {
return $share->getPermissions() === \OCP\Constants::PERMISSION_ALL &&
$share->getPassword() === 'newpassword' &&
$share->getExpirationDate() === $date;
})
- );
+ )->will($this->returnArgument(0));
$expected = new \OC_OCS_Result(null);
$result = $ocs->updateShare(42);
$this->shareManager->method('getShareById')->with('ocinternal:42')->willReturn($share);
$this->shareManager->expects($this->once())->method('updateShare')->with(
- $this->callback(function (IShare $share) {
+ $this->callback(function (\OCP\Share\IShare $share) {
$date = new \DateTime('2010-12-23');
$date->setTime(0,0,0);
$share->getPassword() === 'password' &&
$share->getExpirationDate() == $date;
})
- );
+ )->will($this->returnArgument(0));
$expected = new \OC_OCS_Result(null);
$result = $ocs->updateShare(42);
->setPassword('password')
->setExpirationDate($date)
->setPermissions(\OCP\Constants::PERMISSION_ALL)
- ->setPath($folder);
+ ->setNode($folder);
$this->request
->method('getParam')
$this->shareManager->method('shareApiLinkAllowPublicUpload')->willReturn(true);
$this->shareManager->expects($this->once())->method('updateShare')->with(
- $this->callback(function (IShare $share) use ($date) {
+ $this->callback(function (\OCP\Share\IShare $share) use ($date) {
return $share->getPermissions() === \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_CREATE | \OCP\Constants::PERMISSION_DELETE &&
$share->getPassword() === 'password' &&
$share->getExpirationDate() === $date;
})
- );
+ )->will($this->returnArgument(0));
$expected = new \OC_OCS_Result(null);
$result = $ocs->updateShare(42);
->setPassword('password')
->setExpirationDate($date)
->setPermissions(\OCP\Constants::PERMISSION_ALL)
- ->setPath($folder);
+ ->setNode($folder);
$this->request
->method('getParam')
$this->shareManager->method('shareApiLinkAllowPublicUpload')->willReturn(true);
$this->shareManager->expects($this->once())->method('updateShare')->with(
- $this->callback(function (IShare $share) use ($date) {
+ $this->callback(function (\OCP\Share\IShare $share) use ($date) {
return $share->getPermissions() === \OCP\Constants::PERMISSION_READ | \OCP\Constants::PERMISSION_CREATE | \OCP\Constants::PERMISSION_DELETE &&
$share->getPassword() === 'password' &&
$share->getExpirationDate() === $date;
})
- );
+ )->will($this->returnArgument(0));
$expected = new \OC_OCS_Result(null);
$result = $ocs->updateShare(42);
->setPassword('password')
->setExpirationDate($date)
->setPermissions(\OCP\Constants::PERMISSION_ALL)
- ->setPath($folder);
+ ->setNode($folder);
$this->request
->method('getParam')
$share->setPermissions(\OCP\Constants::PERMISSION_ALL)
->setSharedBy($this->currentUser)
->setShareType(\OCP\Share::SHARE_TYPE_USER)
- ->setPath($file);
+ ->setNode($file);
$this->request
->method('getParam')
$this->shareManager->method('shareApiLinkAllowPublicUpload')->willReturn(true);
$this->shareManager->expects($this->once())->method('updateShare')->with(
- $this->callback(function (IShare $share) {
+ $this->callback(function (\OCP\Share\IShare $share) {
return $share->getPermissions() === \OCP\Constants::PERMISSION_ALL;
})
- );
+ )->will($this->returnArgument(0));
$expected = new \OC_OCS_Result(null);
$result = $ocs->updateShare(42);