@@ -626,6 +626,39 @@ public function shouldGetMergeBase(): void
626
626
$ this ->assertEquals ($ expectedArray , $ api ->mergeBase (1 , ['efgh5678efgh5678efgh5678efgh5678efgh5678 ' , '1234567812345678123456781234567812345678 ' ]));
627
627
}
628
628
629
+ /**
630
+ * @test
631
+ */
632
+ public function shouldCherryPick (): void
633
+ {
634
+ $ expectedArray = [
635
+ 'id ' => 'abcd1234abcd1234abcd1234abcd1234abcd1234 ' ,
636
+ 'short_id ' => 'abcd1234 ' ,
637
+ 'title ' => 'A commit ' ,
638
+ 'author_name ' => 'Example User ' ,
639
+ 'author_email ' =>
'[email protected] ' ,
640
+ 'authored_date ' => '2018-01-01T00:00:00.000Z ' ,
641
+ 'created_at ' => '2018-01-01T00:00:00.000Z ' ,
642
+ 'committer_name ' => 'Jane Doe ' ,
643
+ 'committer_email ' =>
'[email protected] ' ,
644
+ 'committed_date ' => '2018-01-01T00:00:00.000Z ' ,
645
+ 'message ' => 'A commit ' ,
646
+ 'parent_ids ' => [
647
+ 'efgh5678efgh5678efgh5678efgh5678efgh5678 ' ,
648
+ ],
649
+ 'web_url ' => 'https://gitlab.example.com/thedude/gitlab-foss/-/commit/abcd1234abcd1234abcd1234abcd1234abcd1234 ' ,
650
+ ];
651
+
652
+ $ api = $ this ->getApiMock ();
653
+ $ api ->expects ($ this ->once ())
654
+ ->method ('post ' )
655
+ ->with ('projects/1/repository/commits/123456123456/cherry_pick ' , ['branch ' => 'feature_branch ' ])
656
+ ->will ($ this ->returnValue ($ expectedArray ))
657
+ ;
658
+
659
+ $ this ->assertEquals ($ expectedArray , $ api ->cherryPick (1 , '123456123456 ' , ['branch ' => 'feature_branch ' ]));
660
+ }
661
+
629
662
protected function getApiClass ()
630
663
{
631
664
return Repositories::class;
0 commit comments