@@ -32,7 +32,7 @@ public function shouldGetOpenPullRequests()
3232 $ api = $ this ->getApiMock ();
3333 $ api ->expects ($ this ->once ())
3434 ->method ('get ' )
35- ->with ('/repos/ezsystems/ezpublish/pulls ' , ['state ' => 'open ' , ' per_page ' => 30 , ' page ' => 1 ])
35+ ->with ('/repos/ezsystems/ezpublish/pulls ' , ['state ' => 'open ' ])
3636 ->will ($ this ->returnValue ($ expectedArray ));
3737
3838 $ this ->assertEquals ($ expectedArray , $ api ->all ('ezsystems ' , 'ezpublish ' , ['state ' => 'open ' ]));
@@ -48,7 +48,7 @@ public function shouldGetClosedPullRequests()
4848 $ api = $ this ->getApiMock ();
4949 $ api ->expects ($ this ->once ())
5050 ->method ('get ' )
51- ->with ('/repos/ezsystems/ezpublish/pulls ' , ['state ' => 'closed ' , ' per_page ' => 30 , ' page ' => 1 ])
51+ ->with ('/repos/ezsystems/ezpublish/pulls ' , ['state ' => 'closed ' ])
5252 ->will ($ this ->returnValue ($ expectedArray ));
5353
5454 $ this ->assertEquals ($ expectedArray , $ api ->all ('ezsystems ' , 'ezpublish ' , ['state ' => 'closed ' ]));
@@ -103,6 +103,22 @@ public function shouldShowFilesFromPullRequest()
103103 $ this ->assertEquals ($ expectedArray , $ api ->files ('ezsystems ' , 'ezpublish ' , '15 ' ));
104104 }
105105
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+
106122 /**
107123 * @test
108124 */
@@ -211,10 +227,10 @@ public function shouldMergePullRequestWithMergeMethod()
211227 public function shouldCreatePullRequestUsingTitle ()
212228 {
213229 $ data = [
214- 'base ' => 'master ' ,
215- 'head ' => 'virtualtestbranch ' ,
230+ 'base ' => 'master ' ,
231+ 'head ' => 'virtualtestbranch ' ,
216232 '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 ' ,
218234 ];
219235
220236 $ api = $ this ->getApiMock ();
@@ -231,8 +247,8 @@ public function shouldCreatePullRequestUsingTitle()
231247 public function shouldCreatePullRequestUsingIssueId ()
232248 {
233249 $ data = [
234- 'base ' => 'master ' ,
235- 'head ' => 'virtualtestbranch ' ,
250+ 'base ' => 'master ' ,
251+ 'head ' => 'virtualtestbranch ' ,
236252 'issue ' => 25 ,
237253 ];
238254
@@ -251,9 +267,9 @@ public function shouldNotCreatePullRequestWithoutBase()
251267 {
252268 $ this ->expectException (MissingArgumentException::class);
253269 $ data = [
254- 'head ' => 'virtualtestbranch ' ,
270+ 'head ' => 'virtualtestbranch ' ,
255271 '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 ' ,
257273 ];
258274
259275 $ api = $ this ->getApiMock ();
@@ -270,9 +286,9 @@ public function shouldNotCreatePullRequestWithoutHead()
270286 {
271287 $ this ->expectException (MissingArgumentException::class);
272288 $ data = [
273- 'base ' => 'master ' ,
289+ 'base ' => 'master ' ,
274290 '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 ' ,
276292 ];
277293
278294 $ api = $ this ->getApiMock ();
@@ -289,8 +305,8 @@ public function shouldNotCreatePullRequestUsingTitleButWithoutBody()
289305 {
290306 $ this ->expectException (MissingArgumentException::class);
291307 $ data = [
292- 'base ' => 'master ' ,
293- 'head ' => 'virtualtestbranch ' ,
308+ 'base ' => 'master ' ,
309+ 'head ' => 'virtualtestbranch ' ,
294310 'title ' => 'TITLE: Testing pull-request creation from PHP Github API ' ,
295311 ];
296312
0 commit comments