@@ -179,6 +179,65 @@ public function shouldRemoveProject()
179
179
$ this ->assertEquals ($ expectedBool , $ api ->remove (1 ));
180
180
}
181
181
182
+ /**
183
+ * @test
184
+ */
185
+ public function shouldGetBuilds ()
186
+ {
187
+ $ expectedArray = array (
188
+ array ('id ' => 1 , 'status ' => 'success ' ),
189
+ array ('id ' => 2 , 'status ' => 'failed ' )
190
+ );
191
+
192
+ $ api = $ this ->getApiMock ();
193
+ $ api ->expects ($ this ->once ())
194
+ ->method ('get ' )
195
+ ->with ('projects/1/builds ' )
196
+ ->will ($ this ->returnValue ($ expectedArray ))
197
+ ;
198
+
199
+ $ this ->assertEquals ($ expectedArray , $ api ->builds (1 ));
200
+ }
201
+
202
+ /**
203
+ * @test
204
+ */
205
+ public function shouldGetBuildsWithScope ()
206
+ {
207
+ $ expectedArray = array (
208
+ array ('id ' => 1 , 'status ' => 'success ' ),
209
+ );
210
+
211
+ $ api = $ this ->getApiMock ();
212
+ $ api ->expects ($ this ->once ())
213
+ ->method ('get ' )
214
+ ->with ('projects/1/builds ' , array ('scope ' => 'success ' ))
215
+ ->will ($ this ->returnValue ($ expectedArray ))
216
+ ;
217
+
218
+ $ this ->assertEquals ($ expectedArray , $ api ->builds (1 , 'success ' ));
219
+ }
220
+
221
+ /**
222
+ * @test
223
+ */
224
+ public function shouldGetBuildsWithMultipleScopes ()
225
+ {
226
+ $ expectedArray = array (
227
+ array ('id ' => 1 , 'status ' => 'success ' ),
228
+ array ('id ' => 1 , 'status ' => 'failed ' ),
229
+ );
230
+
231
+ $ api = $ this ->getApiMock ();
232
+ $ api ->expects ($ this ->once ())
233
+ ->method ('get ' )
234
+ ->with ('projects/1/builds ' , array ('scope ' => ['success ' , 'failed ' ]))
235
+ ->will ($ this ->returnValue ($ expectedArray ))
236
+ ;
237
+
238
+ $ this ->assertEquals ($ expectedArray , $ api ->builds (1 , ['success ' , 'failed ' ]));
239
+ }
240
+
182
241
/**
183
242
* @test
184
243
*/
0 commit comments