File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
test/Bitbucket/Tests/API/Repositories Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff 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 ' ;
You can’t perform that action at this time.
0 commit comments