Fixing tests

This commit is contained in:
Dan Cryer 2015-10-09 10:14:54 +01:00
commit bb87c4d54c
3 changed files with 33 additions and 5 deletions

View file

@ -30,6 +30,11 @@ class Build extends BuildBase
public $currentBuildPath = null;
/**
* @var \PHPCI\Model\Project $project
*/
protected $project;
/**
* Get link to commit from another source (i.e. Github)
*/
@ -249,4 +254,25 @@ class Build extends BuildBase
exec(sprintf(IS_WIN ? 'rmdir /S /Q "%s"' : 'rm -Rf "%s"', $buildPath));
}
/**
* @param Project $value
*/
public function setProjectObject(\PHPCI\Model\Project $value)
{
$this->project = $value;
return parent::setProjectObject($value);
}
/**
* Get the Project model for this Build by Id.
*/
public function getProject()
{
if (empty($this->project)) {
$this->project = parent::getProject();
}
return $this->project;
}
}