コード例 #1
0
ファイル: share20ocstest.php プロジェクト: ZverAleksey/core
 public function testUpdateNoParametersOther()
 {
     $share = \OC::$server->getShareManager()->newShare();
     $share->setPermissions(\OCP\Constants::PERMISSION_ALL)->setSharedBy($this->currentUser->getUID())->setShareType(\OCP\Share::SHARE_TYPE_GROUP);
     $this->shareManager->method('getShareById')->with('ocinternal:42')->willReturn($share);
     $expected = new \OC_OCS_Result(null, 400, 'Wrong or no update parameter given');
     $result = $this->ocs->updateShare(42);
     $this->assertEquals($expected->getMeta(), $result->getMeta());
     $this->assertEquals($expected->getData(), $result->getData());
 }
コード例 #2
0
 public function testUpdateNoParametersOther()
 {
     $node = $this->getMock('\\OCP\\Files\\Folder');
     $share = $this->newShare();
     $share->setPermissions(\OCP\Constants::PERMISSION_ALL)->setSharedBy($this->currentUser->getUID())->setShareType(\OCP\Share::SHARE_TYPE_GROUP)->setNode($node);
     $node->expects($this->once())->method('lock')->with(\OCP\Lock\ILockingProvider::LOCK_SHARED);
     $this->shareManager->method('getShareById')->with('ocinternal:42')->willReturn($share);
     $expected = new \OC_OCS_Result(null, 400, 'Wrong or no update parameter given');
     $result = $this->ocs->updateShare(42);
     $this->assertEquals($expected->getMeta(), $result->getMeta());
     $this->assertEquals($expected->getData(), $result->getData());
 }