Skip to content

Commit f3d0965

Browse files
author
Daniel André Eikeland
committed
Run tests and fix test failures
1 parent 14ff342 commit f3d0965

File tree

4 files changed

+5
-27
lines changed

4 files changed

+5
-27
lines changed

lib/Gitlab/Api/Deployments.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php namespace Gitlab\Api;
22

3-
class Environments extends AbstractApi
3+
class Deployments extends AbstractApi
44
{
55
/**
66
* @param int $project_id

lib/Gitlab/Api/Environments.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public function all($project_id)
1818
*/
1919
public function create($project_id, array $params = array())
2020
{
21-
return $this->post($this->getProjectPath($project_id, "environment"), $params);
21+
return $this->post($this->getProjectPath($project_id, 'environment'), $params);
2222
}
2323

2424
/**

test/Gitlab/Tests/Api/DeploymentsTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,9 +236,9 @@ public function shouldShowDeployment()
236236
$api = $this->getApiMock();
237237
$api->expects($this->once())
238238
->method('get')
239-
->with('projects/1/deployments/1')
239+
->with('projects/1/deployments/42')
240240
->will($this->returnValue($expectedArray));
241-
$this->assertEquals($expectedArray, $api->show(1, 'v1.0.0'));
241+
$this->assertEquals($expectedArray, $api->show(1, 42));
242242
}
243243

244244
protected function getApiClass()

test/Gitlab/Tests/Api/EnvironmentsTest.php

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -30,28 +30,6 @@ public function shouldGetAllEnvironments()
3030
$this->assertEquals($expectedArray, $api->all(1));
3131
}
3232

33-
/**
34-
* @test
35-
*/
36-
public function shouldShowEnvironment()
37-
{
38-
$expectedArray = array(
39-
array(
40-
'id' => 2,
41-
'name' => 'review/fix-bar',
42-
'slug' => 'review-fix-bar-dfjre4',
43-
'external_url' => 'https://review-fix-bar-dfjre4.example.gitlab.com'
44-
),
45-
);
46-
47-
$api = $this->getApiMock();
48-
$api->expects($this->once())
49-
->method('get')
50-
->with('projects/1/environments/1')
51-
->will($this->returnValue($expectedArray));
52-
$this->assertEquals($expectedArray, $api->show(1, 'v1.0.0'));
53-
}
54-
5533
/**
5634
* @test
5735
*/
@@ -91,7 +69,7 @@ public function shouldRemoveEnvironment()
9169
$api = $this->getApiMock();
9270
$api->expects($this->once())
9371
->method('delete')
94-
->with('projects/1/repository/environments/3')
72+
->with('projects/1/environments/3')
9573
->will($this->returnValue($expectedBool));
9674
$this->assertEquals($expectedBool, $api->remove(1, 3));
9775
}

0 commit comments

Comments
 (0)