Skip to content

Commit b6039dd

Browse files
omarlopesinom1guelpf
authored andcommitted
Tests: projects boards
1 parent 1b0e78d commit b6039dd

File tree

1 file changed

+71
-0
lines changed

1 file changed

+71
-0
lines changed

test/Gitlab/Tests/Api/ProjectsTest.php

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,77 @@ public function getProjectIssuesExpectedArray() {
372372
];
373373
}
374374

375+
/**
376+
* @test
377+
*/
378+
public function shouldGetBoards() {
379+
$expectedArray = $this->getProjectIssuesExpectedArray();
380+
381+
$api = $this->getApiMock();
382+
$api->expects($this->once())
383+
->method('get')
384+
->with('projects/1/boards')
385+
->will($this->returnValue($expectedArray));
386+
387+
$this->assertEquals($expectedArray, $api->boards(1));
388+
}
389+
390+
/**
391+
* Get expected array for tests which check project boards
392+
*
393+
* @return array
394+
* Project issues list.
395+
*/
396+
public function getProjectBoardsExpectedArray() {
397+
return [
398+
[
399+
'id' => 1,
400+
'project' => [
401+
'id' => 5,
402+
'name' => 'Diaspora Project Site',
403+
'name_with_namespace' => 'Diaspora / Diaspora Project Site',
404+
'path' => 'diaspora-project-site',
405+
'path_with_namespace' => 'diaspora/diaspora-project-site',
406+
'http_url_to_repo' => 'http => //example.com/diaspora/diaspora-project-site.git',
407+
'web_url' => 'http => //example.com/diaspora/diaspora-project-site'
408+
],
409+
'milestone' => [
410+
'id' => 12,
411+
'title' => '10.0',
412+
],
413+
'lists' => [
414+
[
415+
'id' => 1,
416+
'label' => [
417+
'name' => 'Testing',
418+
'color' => '#F0AD4E',
419+
'description' => null
420+
],
421+
'position' => 1
422+
],
423+
[
424+
'id' => 2,
425+
'label' => [
426+
'name' => 'Ready',
427+
'color' => '#FF0000',
428+
'description' => null
429+
],
430+
'position' => 2
431+
],
432+
[
433+
'id' => 3,
434+
'label' => [
435+
'name' => 'Production',
436+
'color' => '#FF5F00',
437+
'description' => null
438+
],
439+
'position' => 3
440+
]
441+
]
442+
]
443+
];
444+
}
445+
375446
/**
376447
* @test
377448
*/

0 commit comments

Comments
 (0)