@@ -32,7 +32,7 @@ public function shouldGetOpenPullRequests()
32
32
$ api = $ this ->getApiMock ();
33
33
$ api ->expects ($ this ->once ())
34
34
->method ('get ' )
35
- ->with ('/repos/ezsystems/ezpublish/pulls ' , ['state ' => 'open ' , ' per_page ' => 30 , ' page ' => 1 ])
35
+ ->with ('/repos/ezsystems/ezpublish/pulls ' , ['state ' => 'open ' ])
36
36
->will ($ this ->returnValue ($ expectedArray ));
37
37
38
38
$ this ->assertEquals ($ expectedArray , $ api ->all ('ezsystems ' , 'ezpublish ' , ['state ' => 'open ' ]));
@@ -48,7 +48,7 @@ public function shouldGetClosedPullRequests()
48
48
$ api = $ this ->getApiMock ();
49
49
$ api ->expects ($ this ->once ())
50
50
->method ('get ' )
51
- ->with ('/repos/ezsystems/ezpublish/pulls ' , ['state ' => 'closed ' , ' per_page ' => 30 , ' page ' => 1 ])
51
+ ->with ('/repos/ezsystems/ezpublish/pulls ' , ['state ' => 'closed ' ])
52
52
->will ($ this ->returnValue ($ expectedArray ));
53
53
54
54
$ this ->assertEquals ($ expectedArray , $ api ->all ('ezsystems ' , 'ezpublish ' , ['state ' => 'closed ' ]));
@@ -103,6 +103,22 @@ public function shouldShowFilesFromPullRequest()
103
103
$ this ->assertEquals ($ expectedArray , $ api ->files ('ezsystems ' , 'ezpublish ' , '15 ' ));
104
104
}
105
105
106
+ /**
107
+ * @test
108
+ */
109
+ public function shouldShowFilesFromPullRequestForPage ()
110
+ {
111
+ $ expectedArray = [['id ' => 'id ' , 'sha ' => '123123 ' ]];
112
+
113
+ $ api = $ this ->getApiMock ();
114
+ $ api ->expects ($ this ->once ())
115
+ ->method ('get ' )
116
+ ->with ('/repos/ezsystems/ezpublish/pulls/15/files ' , ['page ' => 2 , 'per_page ' => 30 ])
117
+ ->willReturn ($ expectedArray );
118
+
119
+ $ this ->assertSame ($ expectedArray , $ api ->files ('ezsystems ' , 'ezpublish ' , '15 ' , ['page ' => 2 , 'per_page ' => 30 ]));
120
+ }
121
+
106
122
/**
107
123
* @test
108
124
*/
@@ -211,10 +227,10 @@ public function shouldMergePullRequestWithMergeMethod()
211
227
public function shouldCreatePullRequestUsingTitle ()
212
228
{
213
229
$ data = [
214
- 'base ' => 'master ' ,
215
- 'head ' => 'virtualtestbranch ' ,
230
+ 'base ' => 'master ' ,
231
+ 'head ' => 'virtualtestbranch ' ,
216
232
'title ' => 'TITLE: Testing pull-request creation from PHP Github API ' ,
217
- 'body ' => 'BODY: Testing pull-request creation from PHP Github API ' ,
233
+ 'body ' => 'BODY: Testing pull-request creation from PHP Github API ' ,
218
234
];
219
235
220
236
$ api = $ this ->getApiMock ();
@@ -231,8 +247,8 @@ public function shouldCreatePullRequestUsingTitle()
231
247
public function shouldCreatePullRequestUsingIssueId ()
232
248
{
233
249
$ data = [
234
- 'base ' => 'master ' ,
235
- 'head ' => 'virtualtestbranch ' ,
250
+ 'base ' => 'master ' ,
251
+ 'head ' => 'virtualtestbranch ' ,
236
252
'issue ' => 25 ,
237
253
];
238
254
@@ -251,9 +267,9 @@ public function shouldNotCreatePullRequestWithoutBase()
251
267
{
252
268
$ this ->expectException (MissingArgumentException::class);
253
269
$ data = [
254
- 'head ' => 'virtualtestbranch ' ,
270
+ 'head ' => 'virtualtestbranch ' ,
255
271
'title ' => 'TITLE: Testing pull-request creation from PHP Github API ' ,
256
- 'body ' => 'BODY: Testing pull-request creation from PHP Github API ' ,
272
+ 'body ' => 'BODY: Testing pull-request creation from PHP Github API ' ,
257
273
];
258
274
259
275
$ api = $ this ->getApiMock ();
@@ -270,9 +286,9 @@ public function shouldNotCreatePullRequestWithoutHead()
270
286
{
271
287
$ this ->expectException (MissingArgumentException::class);
272
288
$ data = [
273
- 'base ' => 'master ' ,
289
+ 'base ' => 'master ' ,
274
290
'title ' => 'TITLE: Testing pull-request creation from PHP Github API ' ,
275
- 'body ' => 'BODY: Testing pull-request creation from PHP Github API ' ,
291
+ 'body ' => 'BODY: Testing pull-request creation from PHP Github API ' ,
276
292
];
277
293
278
294
$ api = $ this ->getApiMock ();
@@ -289,8 +305,8 @@ public function shouldNotCreatePullRequestUsingTitleButWithoutBody()
289
305
{
290
306
$ this ->expectException (MissingArgumentException::class);
291
307
$ data = [
292
- 'base ' => 'master ' ,
293
- 'head ' => 'virtualtestbranch ' ,
308
+ 'base ' => 'master ' ,
309
+ 'head ' => 'virtualtestbranch ' ,
294
310
'title ' => 'TITLE: Testing pull-request creation from PHP Github API ' ,
295
311
];
296
312
0 commit comments