Skip to content

Commit 791f563

Browse files
committed
Add New Tests In ReferencesTest For Our Two New Methods
Add New Tests In ReferencesTest For Our Two New Methods
1 parent fe50ad1 commit 791f563

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

test/Github/Tests/Api/GitData/ReferencesTest.php

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,38 @@ public function shouldGetAllRepoReferences()
7171
$this->assertEquals($expectedValue, $api->all('l3l0', 'l3l0repo'));
7272
}
7373

74+
/**
75+
* @test
76+
*/
77+
public function shouldGetAllMatchingBranchRepoReferences()
78+
{
79+
$expectedValue = [['reference' => 'some data']];
80+
81+
$api = $this->getApiMock();
82+
$api->expects($this->once())
83+
->method('get')
84+
->with('/repos/l3l0/l3l0repo/git/matching-refs/heads/branchName')
85+
->will($this->returnValue($expectedValue));
86+
87+
$this->assertEquals($expectedValue, $api->matchingBranch('l3l0', 'l3l0repo', 'branchName'));
88+
}
89+
90+
/**
91+
* @test
92+
*/
93+
public function shouldGetAllMatchingTagRepoReferences()
94+
{
95+
$expectedValue = [['reference' => 'some data']];
96+
97+
$api = $this->getApiMock();
98+
$api->expects($this->once())
99+
->method('get')
100+
->with('/repos/l3l0/l3l0repo/git/matching-refs/tags/tagName')
101+
->will($this->returnValue($expectedValue));
102+
103+
$this->assertEquals($expectedValue, $api->matchingTag('l3l0', 'l3l0repo', 'tagName'));
104+
}
105+
74106
/**
75107
* @test
76108
*/

0 commit comments

Comments
 (0)