Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ See [documentation](doc/customize.md) to know how to customize the client timeou
* The `setHttpClient` method have been removed. Use a `Gitlab\HttpClient\Builder` instead.
* The `getHttpClient` method return type is changed to `Http\Client\Common\HttpMethodsClient`.


## `Gitlab\Api\Groups` changes

* The `visibility_level` parameter have been removed from `create` method. Use `visibility` instead.

## `Gitlab\Api\Issues` changes

* The second argument of `update`, `remove`, `showComments`, `showComment`, `addComment`, `updateComment`, `removeComment`,
Expand Down
5 changes: 3 additions & 2 deletions lib/Gitlab/Api/Groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,16 @@ public function show($id)
* @param string $name
* @param string $path
* @param string $description
* @param string $visibility
* @return mixed
*/
public function create($name, $path, $description = null, $visibility_level = 0)
public function create($name, $path, $description = null, $visibility = 'private')
{
return $this->post('groups', array(
'name' => $name,
'path' => $path,
'description' => $description,
'visibility_level' => $visibility_level
'visibility' => $visibility,
));
}

Expand Down
8 changes: 4 additions & 4 deletions test/Gitlab/Tests/Api/GroupsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public function shouldCreateGroup()
$api = $this->getApiMock();
$api->expects($this->once())
->method('post')
->with('groups', array('name' => 'A new group', 'path' => 'a-new-group', 'description' => null, 'visibility_level' => 0))
->with('groups', array('name' => 'A new group', 'path' => 'a-new-group', 'description' => null, 'visibility' => 'private'))
->will($this->returnValue($expectedArray))
;

Expand All @@ -121,18 +121,18 @@ public function shouldCreateGroup()
/**
* @test
*/
public function shouldCreateGroupWithDescriptionAndVisLevel()
public function shouldCreateGroupWithDescriptionAndVisibility()
{
$expectedArray = array('id' => 1, 'name' => 'A new group', 'visibility_level' => 2);

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

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

/**
Expand Down