Пример #1
0
 /**
  * Validates command setting usage.
  *
  * @param string          $name     Name.
  * @param AbstractCommand $command  Command to get settings from.
  * @param string          $raw_path Raw path.
  *
  * @return AbstractConfigSetting
  * @throws \LogicException When command don't have any config settings to provide.
  */
 protected function getSetting($name, AbstractCommand $command, $raw_path)
 {
     if (!$command instanceof IConfigAwareCommand) {
         throw new \LogicException('The "' . $command->getName() . '" command does not have any settings.');
     }
     $config_setting = $this->findSetting($name, $command->getConfigSettings(), $command->getName());
     if ($config_setting->isWithinScope(AbstractConfigSetting::SCOPE_WORKING_COPY)) {
         $config_setting->setWorkingCopyUrl($this->workingCopyResolver->getWorkingCopyUrl($raw_path));
     }
     $config_setting->setEditor($this->configEditor);
     return $config_setting;
 }
 public function testGetWorkingCopyPathFromDeletedPath()
 {
     $this->createTempFolder();
     $this->connector->isUrl($this->tempFolder . '/deleted')->willReturn(false);
     $this->connector->isUrl($this->tempFolder)->willReturn(false);
     $this->connector->isWorkingCopy($this->tempFolder)->willReturn(true);
     $this->assertEquals($this->tempFolder, $this->workingCopyResolver->getWorkingCopyPath($this->tempFolder . '/deleted'), 'Cache Miss');
     $this->assertEquals($this->tempFolder, $this->workingCopyResolver->getWorkingCopyPath($this->tempFolder . '/deleted'), 'Cache Hit');
 }
Пример #3
0
 /**
  * Return working copy path.
  *
  * @return string
  */
 protected function getWorkingCopyPath()
 {
     return $this->_workingCopyResolver->getWorkingCopyPath($this->getRawPath());
 }