Fixing tests #2
This commit is contained in:
parent
07b92fecf3
commit
f747371c6d
|
@ -30,11 +30,6 @@ class Build extends BuildBase
|
|||
|
||||
public $currentBuildPath = null;
|
||||
|
||||
/**
|
||||
* @var \PHPCI\Model\Project $project
|
||||
*/
|
||||
protected $project;
|
||||
|
||||
/**
|
||||
* Get link to commit from another source (i.e. Github)
|
||||
*/
|
||||
|
@ -260,7 +255,7 @@ class Build extends BuildBase
|
|||
*/
|
||||
public function setProjectObject(\PHPCI\Model\Project $value)
|
||||
{
|
||||
$this->project = $value;
|
||||
$this->data['project'] = $value;
|
||||
return parent::setProjectObject($value);
|
||||
}
|
||||
|
||||
|
@ -269,10 +264,10 @@ class Build extends BuildBase
|
|||
*/
|
||||
public function getProject()
|
||||
{
|
||||
if (empty($this->project)) {
|
||||
$this->project = parent::getProject();
|
||||
if (empty($this->data['project'])) {
|
||||
$this->data['project'] = parent::getProject();
|
||||
}
|
||||
|
||||
return $this->project;
|
||||
return $this->data['project'];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -101,9 +101,13 @@ class BuildServiceTest extends \PHPUnit_Framework_TestCase
|
|||
*/
|
||||
public function testExecute_CreateDuplicateBuild()
|
||||
{
|
||||
$project = new Project();
|
||||
$project->setType('hg');
|
||||
$project->setId(101);
|
||||
|
||||
$build = new Build();
|
||||
$build->setId(1);
|
||||
$build->setProjectId(101);
|
||||
$build->setProject($project);
|
||||
$build->setCommitId('abcde');
|
||||
$build->setStatus(Build::STATUS_FAILED);
|
||||
$build->setLog('Test');
|
||||
|
|
Loading…
Reference in a new issue