File tree Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Expand file tree Collapse file tree 2 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ public function shouldPaginateGetRequests()
1717 $ repositoriesApi = $ this ->client ->api ('user ' );
1818 $ repositoriesApi ->setPerPage (10 );
1919
20- $ pager = new ResultPager ( $ this ->client );
20+ $ pager = $ this ->createPager ( );
2121
2222 $ repositories = $ pager ->fetch ($ repositoriesApi , 'repositories ' , array ('KnpLabs ' ));
2323 $ this ->assertCount (10 , $ repositories );
@@ -26,4 +26,25 @@ public function shouldPaginateGetRequests()
2626 $ repositories = $ pager ->fetch ($ repositoriesApi , 'repositories ' , array ('KnpLabs ' ));
2727 $ this ->assertCount (20 , $ repositories );
2828 }
29+
30+ /**
31+ * @test
32+ *
33+ * results in a search api has different format, see docs
34+ */
35+ public function shouldGetAllResultsFromSearchApi ()
36+ {
37+ $ searchApi = $ this ->client ->search ();
38+ $ searchApi ->setPerPage (10 );
39+
40+ $ pager = $ this ->createPager ();
41+
42+ $ users = $ pager ->fetch ($ searchApi , 'users ' , array ('location:Kyiv ' ));
43+ $ this ->assertCount (10 , $ users );
44+ }
45+
46+ private function createPager ()
47+ {
48+ return new ResultPager ($ this ->client );
49+ }
2950}
Original file line number Diff line number Diff line change 33namespace Github \Tests ;
44
55use Github ;
6- use Github \Client ;
7- use Github \ResultPager ;
86use Github \HttpClient \HttpClientInterface ;
97use Github \Tests \Mock \TestResponse ;
108
You can’t perform that action at this time.
0 commit comments