File tree 2 files changed +41
-0
lines changed
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)
650
650
return $ this ->get ($ this ->getProjectPath ($ project_id , 'languages ' ));
651
651
}
652
652
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
+
653
665
/**
654
666
* @param int $project_id
655
667
* @param array $params (
Original file line number Diff line number Diff line change @@ -1298,6 +1298,35 @@ public function shouldRemoveForkRelation()
1298
1298
$ this ->assertEquals ($ expectedBool , $ api ->removeForkRelation (2 ));
1299
1299
}
1300
1300
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
+
1301
1330
/**
1302
1331
* @test
1303
1332
*/
You can’t perform that action at this time.
0 commit comments