/**
  * Creates an environment for a logged in user
  *
  * @return Environment
  */
 protected function setUserBasedEnv()
 {
     $this->coreTestCase->loginAsUser($this->userId);
     $this->userFolder = $this->server->getUserFolder($this->userId);
     $environment = $this->instantiateEnvironment();
     $environment->setStandardEnv();
     return $environment;
 }
示例#2
0
 /**
  * Shares the file and folder, both publicly and with the tester
  *
  * Warning - File operations don't work properly in the test environment provided by core as
  * the cache is not updated and the scanner does not work. Do not attempt to rename or move
  * files
  */
 private function createShares()
 {
     $this->coreTestCase->loginAsUser($this->sharerUserId);
     // Warning - File first or an error will be triggered because the file belongs to the folder
     $this->sharedFileToken = $this->createShare('file');
     $this->sharedFolderToken = $this->createShare('folder');
     $this->createShare('file', $this->userId);
     $this->createShare('folder', $this->userId);
     $this->coreTestCase->logoutUser();
 }