Skip to content

Commit c3c74d0

Browse files
SirFlipm1guelpf
authored andcommitted
Added test units
1 parent c9a923d commit c3c74d0

File tree

2 files changed

+34
-2
lines changed

2 files changed

+34
-2
lines changed

test/Gitlab/Tests/Api/GroupsTest.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,29 @@ public function shouldGetAllMembers()
199199
$api = $this->getApiMock();
200200
$api->expects($this->once())
201201
->method('get')
202-
->with('groups/1/members/all')
202+
->with('groups/1/members/all/')
203203
->will($this->returnValue($expectedArray))
204204
;
205205

206206
$this->assertEquals($expectedArray, $api->allMembers(1));
207207
}
208208

209+
/**
210+
* @test
211+
*/
212+
public function shouldGetAllMembersUserID()
213+
{
214+
$expectedArray = array('id' => 2, 'name' => 'Bob');
215+
216+
$api = $this->getApiMock();
217+
$api->expects($this->once())
218+
->method('get')
219+
->with('groups/1/members/all/2')
220+
->will($this->returnValue($expectedArray));
221+
222+
$this->assertEquals($expectedArray, $api->allMembers(1,2));
223+
}
224+
209225
/**
210226
* @test
211227
*/

test/Gitlab/Tests/Api/ProjectsTest.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -692,12 +692,28 @@ public function shouldGetAllMembers()
692692
$api = $this->getApiMock();
693693
$api->expects($this->once())
694694
->method('get')
695-
->with('projects/1/members/all')
695+
->with('projects/1/members/all/')
696696
->will($this->returnValue($expectedArray));
697697

698698
$this->assertEquals($expectedArray, $api->allMembers(1));
699699
}
700700

701+
/**
702+
* @test
703+
*/
704+
public function shouldGetAllMembersUserID()
705+
{
706+
$expectedArray = array('id' => 2, 'name' => 'Bob');
707+
708+
$api = $this->getApiMock();
709+
$api->expects($this->once())
710+
->method('get')
711+
->with('projects/1/members/all/2')
712+
->will($this->returnValue($expectedArray));
713+
714+
$this->assertEquals($expectedArray, $api->allMembers(1,2));
715+
}
716+
701717
/**
702718
* @test
703719
*/

0 commit comments

Comments
 (0)