Skip to content

Commit 5a5231e

Browse files
committed
unit test for remove branch protection method
1 parent 59ba94c commit 5a5231e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/Github/Tests/Api/Repository/ProtectionTest.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,22 @@ public function shouldUpdateProtection()
3939
$this->assertEquals($expectedValue, $api->update('KnpLabs', 'php-github-api', 'master', $data));
4040
}
4141

42+
/**
43+
* @test
44+
*/
45+
public function shouldRemoveProtection()
46+
{
47+
$expectedValue = array('someOutput');
48+
49+
$api = $this->getApiMock();
50+
$api->expects($this->once())
51+
->method('delete')
52+
->with('/repos/KnpLabs/php-github-api/branches/master/protection')
53+
->will($this->returnValue($expectedValue));
54+
55+
$this->assertEquals($expectedValue, $api->remove('KnpLabs', 'php-github-api', 'master'));
56+
}
57+
4258
/**
4359
* @return string
4460
*/

0 commit comments

Comments
 (0)