예제 #1
0
 /**
  * @param Application $application
  * @return string
  */
 public function getWorkspacePath(Application $application)
 {
     $workspacePath = FLOW_PATH_DATA . 'Surf/';
     if ($application->hasOption('repositoryUrl')) {
         $urlParts = GeneralUtility::getUrlPartsFromRepositoryUrl($application->getOption('repositoryUrl'));
         $workspacePath .= preg_replace('/[^a-zA-Z0-9]/', '-', $urlParts['path']);
         $workspacePath .= '_' . substr(sha1($application->getOption('repositoryUrl')), 0, 5);
     } else {
         // Default
         $workspacePath .= $this->getName() . '/' . $application->getName();
     }
     return $workspacePath;
 }
예제 #2
0
 /**
  * @return void
  * @test
  * @dataProvider getRepositoryUrlDataProvider
  */
 public function getUrlPartsFromRepositoryUrlReturnsArrayForValidRepositoryUrl($repositoryUrl, $expectation)
 {
     $this->assertSame(GeneralUtility::getUrlPartsFromRepositoryUrl($repositoryUrl), $expectation);
 }