@@ -101,6 +101,28 @@ public function shouldShowFilesFromPullRequest()
101
101
$ this ->assertEquals ($ expectedArray , $ api ->files ('ezsystems ' , 'ezpublish ' , '15 ' ));
102
102
}
103
103
104
+ /**
105
+ * @test
106
+ */
107
+ public function shouldShowStatusesFromPullRequest ()
108
+ {
109
+ $ expectedArray = array (array ('id ' => 'id ' , 'sha ' => '123123 ' ));
110
+ $ expectedArray ['_links ' ]['statuses ' ]['href ' ] = '/repos/ezsystems/ezpublish/pulls/15/statuses ' ;
111
+
112
+ $ api = $ this ->getApiMock ();
113
+ $ api ->expects ($ this ->at (0 ))
114
+ ->method ('get ' )
115
+ ->with ('/repos/ezsystems/ezpublish/pulls/15 ' )
116
+ ->will ($ this ->returnValue ($ expectedArray ));
117
+
118
+ $ api ->expects ($ this ->at (1 ))
119
+ ->method ('get ' )
120
+ ->with ('/repos/ezsystems/ezpublish/pulls/15/statuses ' )
121
+ ->will ($ this ->returnValue ($ expectedArray ));
122
+
123
+ $ this ->assertEquals ($ expectedArray , $ api ->status ('ezsystems ' , 'ezpublish ' , '15 ' ));
124
+ }
125
+
104
126
/**
105
127
* @test
106
128
*/
@@ -187,10 +209,10 @@ public function shouldMergePullRequestWithMergeMethod()
187
209
public function shouldCreatePullRequestUsingTitle ()
188
210
{
189
211
$ data = array (
190
- 'base ' => 'master ' ,
191
- 'head ' => 'virtualtestbranch ' ,
212
+ 'base ' => 'master ' ,
213
+ 'head ' => 'virtualtestbranch ' ,
192
214
'title ' => 'TITLE: Testing pull-request creation from PHP Github API ' ,
193
- 'body ' => 'BODY: Testing pull-request creation from PHP Github API '
215
+ 'body ' => 'BODY: Testing pull-request creation from PHP Github API ' ,
194
216
);
195
217
196
218
$ api = $ this ->getApiMock ();
@@ -207,9 +229,9 @@ public function shouldCreatePullRequestUsingTitle()
207
229
public function shouldCreatePullRequestUsingIssueId ()
208
230
{
209
231
$ data = array (
210
- 'base ' => 'master ' ,
211
- 'head ' => 'virtualtestbranch ' ,
212
- 'issue ' => 25
232
+ 'base ' => 'master ' ,
233
+ 'head ' => 'virtualtestbranch ' ,
234
+ 'issue ' => 25 ,
213
235
);
214
236
215
237
$ api = $ this ->getApiMock ();
@@ -227,9 +249,9 @@ public function shouldCreatePullRequestUsingIssueId()
227
249
public function shouldNotCreatePullRequestWithoutBase ()
228
250
{
229
251
$ data = array (
230
- 'head ' => 'virtualtestbranch ' ,
252
+ 'head ' => 'virtualtestbranch ' ,
231
253
'title ' => 'TITLE: Testing pull-request creation from PHP Github API ' ,
232
- 'body ' => 'BODY: Testing pull-request creation from PHP Github API '
254
+ 'body ' => 'BODY: Testing pull-request creation from PHP Github API ' ,
233
255
);
234
256
235
257
$ api = $ this ->getApiMock ();
@@ -246,9 +268,9 @@ public function shouldNotCreatePullRequestWithoutBase()
246
268
public function shouldNotCreatePullRequestWithoutHead ()
247
269
{
248
270
$ data = array (
249
- 'base ' => 'master ' ,
271
+ 'base ' => 'master ' ,
250
272
'title ' => 'TITLE: Testing pull-request creation from PHP Github API ' ,
251
- 'body ' => 'BODY: Testing pull-request creation from PHP Github API '
273
+ 'body ' => 'BODY: Testing pull-request creation from PHP Github API ' ,
252
274
);
253
275
254
276
$ api = $ this ->getApiMock ();
@@ -265,8 +287,8 @@ public function shouldNotCreatePullRequestWithoutHead()
265
287
public function shouldNotCreatePullRequestUsingTitleButWithoutBody ()
266
288
{
267
289
$ data = array (
268
- 'base ' => 'master ' ,
269
- 'head ' => 'virtualtestbranch ' ,
290
+ 'base ' => 'master ' ,
291
+ 'head ' => 'virtualtestbranch ' ,
270
292
'title ' => 'TITLE: Testing pull-request creation from PHP Github API ' ,
271
293
);
272
294
@@ -284,8 +306,8 @@ public function shouldNotCreatePullRequestUsingTitleButWithoutBody()
284
306
public function shouldNotCreatePullRequestWithoutIssueIdOrTitle ()
285
307
{
286
308
$ data = array (
287
- 'base ' => 'master ' ,
288
- 'head ' => 'virtualtestbranch ' ,
309
+ 'base ' => 'master ' ,
310
+ 'head ' => 'virtualtestbranch ' ,
289
311
);
290
312
291
313
$ api = $ this ->getApiMock ();
0 commit comments