Skip to content

Commit 7716af0

Browse files
committed
Added test for adding new restriction type
1 parent 0d561b4 commit 7716af0

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/Bitbucket/Tests/API/Repositories/BranchRestrictionsTest.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,25 @@ public function testGetAllRestrictions()
2525
$this->assertEquals($expectedResult, $actual);
2626
}
2727

28+
public function testAddRestrictionType()
29+
{
30+
$endpoint = 'repositories/gentle/eof/branch-restrictions';
31+
$params = array(
32+
'kind' => 'testpermission'
33+
);
34+
35+
$client = $this->getHttpClientMock();
36+
$client->expects($this->once())
37+
->method('post')
38+
->with($endpoint, json_encode($params));
39+
40+
/** @var \Bitbucket\API\Repositories\BranchRestrictions $restrictions */
41+
$restrictions = $this->getClassMock('Bitbucket\API\Repositories\BranchRestrictions', $client);
42+
$restrictions->addAllowedRestrictionType(array('testpermission'));
43+
44+
$restrictions->create('gentle', 'eof', $params);
45+
}
46+
2847
public function testCreateRestrictionFromArray()
2948
{
3049
$endpoint = 'repositories/gentle/eof/branch-restrictions';

0 commit comments

Comments
 (0)