File tree Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Expand file tree Collapse file tree 2 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -650,6 +650,18 @@ public function languages($project_id)
650650 return $ this ->get ($ this ->getProjectPath ($ project_id , 'languages ' ));
651651 }
652652
653+ /**
654+ * @param int $project_id
655+ * @param array $parameters
656+ * @return mixed
657+ */
658+ public function forks ($ project_id , array $ parameters = [])
659+ {
660+ $ resolver = $ this ->createOptionsResolver ();
661+
662+ return $ this ->get ($ this ->getProjectPath ($ project_id , 'forks ' ), $ resolver ->resolve ($ parameters ));
663+ }
664+
653665 /**
654666 * @param int $project_id
655667 * @param array $params (
Original file line number Diff line number Diff 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 */
You can’t perform that action at this time.
0 commit comments