Example #1
0
 public function testInterpolate_LeavesStringsUnchangedWhenBuildIsSet()
 {
     $build = $this->prophesize('PHPCI\\Model\\Build')->reveal();
     $string = "Hello World";
     $expectedOutput = "Hello World";
     $this->testedInterpolator->setupInterpolationVars($build, "/buildpath/", "phpci.com");
     $actualOutput = $this->testedInterpolator->interpolate($string);
     $this->assertEquals($expectedOutput, $actualOutput);
 }
Example #2
0
 /**
  * Set up a working copy of the project for building.
  */
 protected function setupBuild()
 {
     $this->buildPath = $this->build->getBuildPath();
     $this->interpolator->setupInterpolationVars($this->build, $this->buildPath, PHPCI_URL);
     $this->commandExecutor->setBuildPath($this->buildPath);
     // Create a working copy of the project:
     if (!$this->build->createWorkingCopy($this, $this->buildPath)) {
         throw new \Exception(Lang::get('could_not_create_working'));
     }
     // Does the project's phpci.yml request verbose mode?
     if (!isset($this->config['build_settings']['verbose']) || !$this->config['build_settings']['verbose']) {
         $this->verbose = false;
     }
     // Does the project have any paths it wants plugins to ignore?
     if (isset($this->config['build_settings']['ignore'])) {
         $this->ignore = $this->config['build_settings']['ignore'];
     }
     $this->buildLogger->logSuccess(Lang::get('working_copy_created', $this->buildPath));
     return true;
 }
Example #3
0
 /**
  * Set up a working copy of the project for building.
  */
 protected function setupBuild()
 {
     $buildId = 'project' . $this->build->getProject()->getId() . '-build' . $this->build->getId();
     $this->ciDir = dirname(dirname(__FILE__) . '/../') . '/';
     $this->buildPath = $this->ciDir . 'build/' . $buildId . '/';
     $this->build->currentBuildPath = $this->buildPath;
     $this->interpolator->setupInterpolationVars($this->build, $this->buildPath, PHPCI_URL);
     // Create a working copy of the project:
     if (!$this->build->createWorkingCopy($this, $this->buildPath)) {
         throw new \Exception('Could not create a working copy.');
     }
     // Does the project's phpci.yml request verbose mode?
     if (!isset($this->config['build_settings']['verbose']) || !$this->config['build_settings']['verbose']) {
         $this->verbose = false;
     }
     // Does the project have any paths it wants plugins to ignore?
     if (isset($this->config['build_settings']['ignore'])) {
         $this->ignore = $this->config['build_settings']['ignore'];
     }
     $this->buildLogger->logSuccess('Working copy created: ' . $this->buildPath);
     return true;
 }