Skip to content

Commit 48f1df2

Browse files
authored
minor KnpLabs#1007 Add comment on AbstractApi::$perPage() (Nyholm)
This PR was merged into the 3.3.x-dev branch. Discussion ---------- The `AbstractApi::setPerPage()` was removed in the 3.0. I cannot find what PR that removed it. However, we kept `AbstractApi::$perPage` and we do use it on a few places.. Im not sure if we should remove the property or add back the method. Also note, some integration tests are using `setPerPage()`. Commits ------- aeeda19 Added comment on AbstractApi::$perPage
2 parents 46e9538 + aeeda19 commit 48f1df2

File tree

2 files changed

+1
-21
lines changed

2 files changed

+1
-21
lines changed

lib/Github/Api/AbstractApi.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ abstract class AbstractApi
2020
private $client;
2121

2222
/**
23-
* The per page parameter.
23+
* The per page parameter. It is used by the ResultPager.
2424
*
2525
* @var int|null
2626
*/

test/Github/Tests/Integration/ResultPagerTest.php

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,6 @@
99
*/
1010
class ResultPagerTest extends TestCase
1111
{
12-
/**
13-
* @test
14-
*/
15-
public function shouldPaginateGetRequests()
16-
{
17-
$repositoriesApi = $this->client->api('user');
18-
$repositoriesApi->setPerPage(10);
19-
20-
$pager = $this->createPager();
21-
22-
$repositories = $pager->fetch($repositoriesApi, 'repositories', ['KnpLabs']);
23-
$this->assertCount(10, $repositories);
24-
25-
$repositoriesApi->setPerPage(20);
26-
$repositories = $pager->fetch($repositoriesApi, 'repositories', ['KnpLabs']);
27-
$this->assertCount(20, $repositories);
28-
}
29-
3012
/**
3113
* @test
3214
*
@@ -43,10 +25,8 @@ public function shouldPaginateGetRequests()
4325
public function shouldGetAllResultsFromSearchApi()
4426
{
4527
$searchApi = $this->client->search();
46-
$searchApi->setPerPage(10);
4728

4829
$pager = $this->createPager();
49-
5030
$users = $pager->fetch($searchApi, 'users', ['location:Kyiv']);
5131
$this->assertCount(10, $users);
5232
}

0 commit comments

Comments
 (0)