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()
17
17
$ repositoriesApi = $ this ->client ->api ('user ' );
18
18
$ repositoriesApi ->setPerPage (10 );
19
19
20
- $ pager = new ResultPager ( $ this ->client );
20
+ $ pager = $ this ->createPager ( );
21
21
22
22
$ repositories = $ pager ->fetch ($ repositoriesApi , 'repositories ' , array ('KnpLabs ' ));
23
23
$ this ->assertCount (10 , $ repositories );
@@ -26,4 +26,25 @@ public function shouldPaginateGetRequests()
26
26
$ repositories = $ pager ->fetch ($ repositoriesApi , 'repositories ' , array ('KnpLabs ' ));
27
27
$ this ->assertCount (20 , $ repositories );
28
28
}
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
+ }
29
50
}
Original file line number Diff line number Diff line change 3
3
namespace Github \Tests ;
4
4
5
5
use Github ;
6
- use Github \Client ;
7
- use Github \ResultPager ;
8
6
use Github \HttpClient \HttpClientInterface ;
9
7
use Github \Tests \Mock \TestResponse ;
10
8
You can’t perform that action at this time.
0 commit comments