Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions lib/Gitlab/Api/Projects.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,15 @@ public function remove($project_id)
{
return $this->delete('projects/'.$this->encodePath($project_id));
}

/**
* @param int $project_id
* @return mixed
*/
public function archive($project_id){
return $this->post("projects/".$this->encodePath($project_id)."/archive");
}

/**
* @param int $project_id
* @return mixed
Expand Down Expand Up @@ -165,6 +165,16 @@ public function build($project_id, $build_id)
return $this->get($this->getProjectPath($project_id, 'builds/'.$this->encodePath($build_id)));
}

/**
* @param $project_id
* @param $build_id
* @return mixed
*/
public function buildArtifacts($project_id, $build_id)
{
return $this->get($this->getProjectPath($project_id, 'builds/'.$this->encodePath($build_id).'/artifacts'));
}

/**
* @param $project_id
* @param $build_id
Expand Down
16 changes: 16 additions & 0 deletions test/Gitlab/Tests/Api/ProjectsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,22 @@ public function shouldGetBuild()
$this->assertEquals($expectedArray, $api->build(1, 2));
}

/**
* @test
*/
public function shouldGetBuildArtifacts(){
$expectedArray = array();

$api = $this->getApiMock();
$api->expects($this->once())
->method('get')
->with('projects/1/builds/2/artifacts')
->will($this->returnValue($expectedArray))
;

$this->assertEquals($expectedArray,$api->buildArtifacts(1, 2));
}

/**
* @test
*/
Expand Down