/**
  * 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;
 }
 /**
  * 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();
 }
 /**
  * Invokes private methods
  *
  * CODECEPTION SPECIFIC
  * This is from the core TestCase
  *
  * @param $object
  * @param $methodName
  * @param array $parameters
  *
  * @return mixed
  */
 public function invokePrivate($object, $methodName, array $parameters = [])
 {
     return $this->coreTestCase->invokePrivate($object, $methodName, $parameters);
 }