Skip to content

Commit b80d826

Browse files
authored
Merge pull request #218 from fbourigault/v4-api-9337
replace visibility_level by visibility
2 parents cd1014b + b1d94c9 commit b80d826

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

UPGRADE.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ See [documentation](doc/customize.md) to know how to customize the client timeou
1313
* The `setHttpClient` method have been removed. Use a `Gitlab\HttpClient\Builder` instead.
1414
* The `getHttpClient` method return type is changed to `Http\Client\Common\HttpMethodsClient`.
1515

16+
17+
## `Gitlab\Api\Groups` changes
18+
19+
* The `visibility_level` parameter have been removed from `create` method. Use `visibility` instead.
20+
1621
## `Gitlab\Api\Issues` changes
1722

1823
* The second argument of `update`, `remove`, `showComments`, `showComment`, `addComment`, `updateComment`, `removeComment`,

lib/Gitlab/Api/Groups.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,16 @@ public function show($id)
4242
* @param string $name
4343
* @param string $path
4444
* @param string $description
45+
* @param string $visibility
4546
* @return mixed
4647
*/
47-
public function create($name, $path, $description = null, $visibility_level = 0)
48+
public function create($name, $path, $description = null, $visibility = 'private')
4849
{
4950
return $this->post('groups', array(
5051
'name' => $name,
5152
'path' => $path,
5253
'description' => $description,
53-
'visibility_level' => $visibility_level
54+
'visibility' => $visibility,
5455
));
5556
}
5657

test/Gitlab/Tests/Api/GroupsTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public function shouldCreateGroup()
111111
$api = $this->getApiMock();
112112
$api->expects($this->once())
113113
->method('post')
114-
->with('groups', array('name' => 'A new group', 'path' => 'a-new-group', 'description' => null, 'visibility_level' => 0))
114+
->with('groups', array('name' => 'A new group', 'path' => 'a-new-group', 'description' => null, 'visibility' => 'private'))
115115
->will($this->returnValue($expectedArray))
116116
;
117117

@@ -121,18 +121,18 @@ public function shouldCreateGroup()
121121
/**
122122
* @test
123123
*/
124-
public function shouldCreateGroupWithDescriptionAndVisLevel()
124+
public function shouldCreateGroupWithDescriptionAndVisibility()
125125
{
126126
$expectedArray = array('id' => 1, 'name' => 'A new group', 'visibility_level' => 2);
127127

128128
$api = $this->getApiMock();
129129
$api->expects($this->once())
130130
->method('post')
131-
->with('groups', array('name' => 'A new group', 'path' => 'a-new-group', 'description' => 'Description', 'visibility_level' => 2))
131+
->with('groups', array('name' => 'A new group', 'path' => 'a-new-group', 'description' => 'Description', 'visibility' => 'public'))
132132
->will($this->returnValue($expectedArray))
133133
;
134134

135-
$this->assertEquals($expectedArray, $api->create('A new group', 'a-new-group', 'Description', 2));
135+
$this->assertEquals($expectedArray, $api->create('A new group', 'a-new-group', 'Description', 'public'));
136136
}
137137

138138
/**

0 commit comments

Comments
 (0)