Skip to content

Commit b54ccc0

Browse files
committed
Add Test for projects/forks API Call
1 parent 13b3a9b commit b54ccc0

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

test/Gitlab/Tests/Api/ProjectsTest.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,6 +1298,35 @@ public function shouldRemoveForkRelation()
12981298
$this->assertEquals($expectedBool, $api->removeForkRelation(2));
12991299
}
13001300

1301+
1302+
/**
1303+
* @test
1304+
*/
1305+
public function shouldGetForks()
1306+
{
1307+
$expectedArray = [
1308+
[
1309+
'id' => 2,
1310+
'forked_from_project' => [
1311+
'id' => 1
1312+
]
1313+
],
1314+
[
1315+
'id' => 3,
1316+
'forked_from_project' => [
1317+
'id' => 1
1318+
]
1319+
],
1320+
];
1321+
$api = $this->getApiMock();
1322+
$api->expects($this->once())
1323+
->method('get')
1324+
->with('projects/1/forks')
1325+
->will($this->returnValue($expectedArray));
1326+
1327+
$this->assertEquals($expectedArray, $api->forks(1));
1328+
}
1329+
13011330
/**
13021331
* @test
13031332
*/

0 commit comments

Comments
 (0)