Skip to content

Commit f317387

Browse files
committed
remove build related methods in projects api
1 parent 324000b commit f317387

File tree

3 files changed

+3
-125
lines changed

3 files changed

+3
-125
lines changed

UPGRADE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ Use the `deployKeys`, `deployKey`, `addDeployKey`, `deleteDeployKey`, `removeDep
3030
* The `ORDER_BY` and `SORT` class constants have been removed.
3131
* The `accessible`, `owned` and `search` methods have been removed. Use `all` method instead.
3232
* The `all` method now take a single argument which is an associative array of query string parameters.
33+
* The `trace` method have been removed. Use `Gitlab\Api\Jobs::trace` instead.
34+
* The `builds` method have been removed. Use `Gitlab\Api\Jobs::all` instead.
35+
* The `build` method have been removed. Use `Gitlab\Api\Jobs::show` instead.
3336

3437
## `Gitlab\Api\Repositories` changes
3538

lib/Gitlab/Api/Projects.php

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -147,38 +147,6 @@ public function unarchive($project_id){
147147
return $this->post("projects/".$this->encodePath($project_id)."/unarchive");
148148
}
149149

150-
/**
151-
* @param int $project_id
152-
* @param array $scope
153-
* @return mixed
154-
*/
155-
public function builds($project_id, $scope = null)
156-
{
157-
return $this->get($this->getProjectPath($project_id, 'builds'), array(
158-
'scope' => $scope
159-
));
160-
}
161-
162-
/**
163-
* @param int $project_id
164-
* @param int $build_id
165-
* @return mixed
166-
*/
167-
public function build($project_id, $build_id)
168-
{
169-
return $this->get($this->getProjectPath($project_id, 'builds/'.$this->encodePath($build_id)));
170-
}
171-
172-
/**
173-
* @param int $project_id
174-
* @param int $build_id
175-
* @return mixed
176-
*/
177-
public function trace($project_id, $build_id)
178-
{
179-
return $this->get($this->getProjectPath($project_id, 'builds/'.$this->encodePath($build_id).'/trace'));
180-
}
181-
182150
/**
183151
* @param int $project_id
184152
* @return mixed

test/Gitlab/Tests/Api/ProjectsTest.php

Lines changed: 0 additions & 93 deletions
Original file line numberDiff line numberDiff line change
@@ -207,99 +207,6 @@ public function shouldRemoveProject()
207207
$this->assertEquals($expectedBool, $api->remove(1));
208208
}
209209

210-
/**
211-
* @test
212-
*/
213-
public function shouldGetBuilds()
214-
{
215-
$expectedArray = array(
216-
array('id' => 1, 'status' => 'success'),
217-
array('id' => 2, 'status' => 'failed')
218-
);
219-
220-
$api = $this->getApiMock();
221-
$api->expects($this->once())
222-
->method('get')
223-
->with('projects/1/builds')
224-
->will($this->returnValue($expectedArray))
225-
;
226-
227-
$this->assertEquals($expectedArray, $api->builds(1));
228-
}
229-
230-
/**
231-
* @test
232-
*/
233-
public function shouldGetBuildsWithScope()
234-
{
235-
$expectedArray = array(
236-
array('id' => 1, 'status' => 'success'),
237-
);
238-
239-
$api = $this->getApiMock();
240-
$api->expects($this->once())
241-
->method('get')
242-
->with('projects/1/builds', array('scope' => 'success'))
243-
->will($this->returnValue($expectedArray))
244-
;
245-
246-
$this->assertEquals($expectedArray, $api->builds(1, 'success'));
247-
}
248-
249-
/**
250-
* @test
251-
*/
252-
public function shouldGetBuildsWithMultipleScopes()
253-
{
254-
$expectedArray = array(
255-
array('id' => 1, 'status' => 'success'),
256-
array('id' => 1, 'status' => 'failed'),
257-
);
258-
259-
$api = $this->getApiMock();
260-
$api->expects($this->once())
261-
->method('get')
262-
->with('projects/1/builds', array('scope' => array('success', 'failed')))
263-
->will($this->returnValue($expectedArray))
264-
;
265-
266-
$this->assertEquals($expectedArray, $api->builds(1, array('success', 'failed')));
267-
}
268-
269-
/**
270-
* @test
271-
*/
272-
public function shouldGetBuild()
273-
{
274-
$expectedArray = array('id' => 2);
275-
276-
$api = $this->getApiMock();
277-
$api->expects($this->once())
278-
->method('get')
279-
->with('projects/1/builds/2')
280-
->will($this->returnValue($expectedArray))
281-
;
282-
283-
$this->assertEquals($expectedArray, $api->build(1, 2));
284-
}
285-
286-
/**
287-
* @test
288-
*/
289-
public function shouldGetTrace()
290-
{
291-
$expectedString = 'runner trace of a specific build';
292-
293-
$api = $this->getApiMock();
294-
$api->expects($this->once())
295-
->method('get')
296-
->with('projects/1/builds/2/trace')
297-
->will($this->returnValue($expectedString))
298-
;
299-
300-
$this->assertEquals($expectedString, $api->trace(1, 2));
301-
}
302-
303210
/**
304211
* @test
305212
*/

0 commit comments

Comments
 (0)