@@ -108,6 +108,47 @@ public function shouldShowDeployment(): void
108108 $ this ->assertEquals ($ expectedArray , $ api ->show (1 , 42 ));
109109 }
110110
111+ #[Test]
112+ public function shouldGetDeploymentMergeRequests (): void
113+ {
114+ $ expectedArray = [
115+ ['id ' => 1 , 'title ' => 'A merge request ' ],
116+ ['id ' => 2 , 'title ' => 'Another merge request ' ],
117+ ];
118+
119+ $ api = $ this ->getApiMock ();
120+ $ api ->expects ($ this ->once ())
121+ ->method ('get ' )
122+ ->with ('projects/1/deployments/42/merge_requests ' , [])
123+ ->willReturn ($ expectedArray )
124+ ;
125+
126+ $ this ->assertEquals ($ expectedArray , $ api ->mergeRequests (1 , 42 ));
127+ }
128+
129+ #[Test]
130+ public function shouldGetDeploymentMergeRequestsWithParameters (): void
131+ {
132+ $ expectedArray = [
133+ ['id ' => 1 , 'title ' => 'A merge request ' ],
134+ ];
135+ $ parameters = [
136+ 'state ' => 'merged ' ,
137+ 'labels ' => 'release,backend ' ,
138+ 'page ' => 2 ,
139+ 'per_page ' => 25 ,
140+ ];
141+
142+ $ api = $ this ->getApiMock ();
143+ $ api ->expects ($ this ->once ())
144+ ->method ('get ' )
145+ ->with ('projects/1/deployments/42/merge_requests ' , $ parameters )
146+ ->willReturn ($ expectedArray )
147+ ;
148+
149+ $ this ->assertEquals ($ expectedArray , $ api ->mergeRequests (1 , 42 , $ parameters ));
150+ }
151+
111152 private function getMultipleDeploymentsData (): array
112153 {
113154 return [
0 commit comments