diff --git a/lib/Gitlab/Api/Projects.php b/lib/Gitlab/Api/Projects.php index 52a40690a..27dc66eb8 100644 --- a/lib/Gitlab/Api/Projects.php +++ b/lib/Gitlab/Api/Projects.php @@ -126,7 +126,7 @@ public function remove($project_id) { return $this->delete('projects/'.$this->encodePath($project_id)); } - + /** * @param int $project_id * @return mixed @@ -134,7 +134,7 @@ public function remove($project_id) public function archive($project_id){ return $this->post("projects/".$this->encodePath($project_id)."/archive"); } - + /** * @param int $project_id * @return mixed @@ -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 diff --git a/test/Gitlab/Tests/Api/ProjectsTest.php b/test/Gitlab/Tests/Api/ProjectsTest.php index fb5a5ec33..c47aabd55 100644 --- a/test/Gitlab/Tests/Api/ProjectsTest.php +++ b/test/Gitlab/Tests/Api/ProjectsTest.php @@ -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 */