コード例 #1
0
ファイル: view.php プロジェクト: jhmadhav/core
 protected function tearDown()
 {
     \OC_User::setUserId($this->user);
     foreach ($this->storages as $storage) {
         $cache = $storage->getCache();
         $ids = $cache->getAll();
         $cache->clear();
     }
     if ($this->tempStorage && !\OC_Util::runningOnWindows()) {
         system('rm -rf ' . escapeshellarg($this->tempStorage->getDataDir()));
     }
     $this->logout();
     $this->userObject->delete();
     $this->groupObject->delete();
     parent::tearDown();
 }
コード例 #2
0
 public function testPropagateWhenRemovedFromGroupWithSubdirTarget()
 {
     $this->recipientGroup->addUser($this->recipientUser);
     // relogin to refresh mount points
     $this->loginAsUser($this->recipientUser->getUID());
     $recipientView = new View('/' . $this->recipientUser->getUID() . '/files');
     $this->assertTrue($recipientView->mkdir('sub'));
     $this->assertTrue($recipientView->rename('folder', 'sub/folder'));
     $this->propagationManager->expects($this->once())->method('propagateSharesToUser')->with($this->callback(function ($shares) {
         if (count($shares) !== 1) {
             return false;
         }
         $share = array_values($shares)[0];
         return $share['file_source'] === $this->fileInfo['fileid'] && $share['share_with'] === $this->recipientGroup->getGID() && $share['file_target'] === '/sub/folder';
     }), $this->recipientUser->getUID());
     $this->recipientGroup->removeUser($this->recipientUser);
 }
コード例 #3
0
ファイル: ViewTest.php プロジェクト: rchicoli/owncloud-core
 protected function tearDown()
 {
     \OC_User::setUserId($this->user);
     foreach ($this->storages as $storage) {
         $cache = $storage->getCache();
         $ids = $cache->getAll();
         $cache->clear();
     }
     if ($this->tempStorage && !\OC_Util::runningOnWindows()) {
         system('rm -rf ' . escapeshellarg($this->tempStorage->getDataDir()));
     }
     $this->logout();
     $this->userObject->delete();
     $this->groupObject->delete();
     $mountProviderCollection = \OC::$server->getMountProviderCollection();
     \Test\TestCase::invokePrivate($mountProviderCollection, 'providers', [[]]);
     parent::tearDown();
 }
コード例 #4
0
ファイル: SubAdmin.php プロジェクト: GitHubUser4234/core
 /**
  * delete all SubAdmins by $group
  * @param IGroup $group
  * @return boolean
  */
 private function post_deleteGroup($group)
 {
     $qb = $this->dbConn->getQueryBuilder();
     $qb->delete('group_admin')->where($qb->expr()->eq('gid', $qb->createNamedParameter($group->getGID())))->execute();
     return true;
 }
コード例 #5
0
ファイル: metadata.php プロジェクト: samj1912/repo
 /**
  * creates an array containing the group meta data
  * @param \OCP\IGroup $group
  * @param string $userSearch
  * @return array with the keys 'id', 'name' and 'usercount'
  */
 private function generateGroupMetaData(\OCP\IGroup $group, $userSearch)
 {
     return array('id' => $group->getGID(), 'name' => $group->getGID(), 'usercount' => $this->sorting === self::SORT_USERCOUNT ? $group->count($userSearch) : 0);
 }
コード例 #6
0
 /**
  * @param IGroup $group
  * @return array
  */
 protected function groupToPrincipal($group)
 {
     $groupId = $group->getGID();
     $principal = ['uri' => "principals/groups/{$groupId}", '{DAV:}displayname' => $groupId];
     return $principal;
 }