forked from KnpLabs/php-github-api
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deprecate ResultPager::postFetch method
- Loading branch information
Showing
6 changed files
with
46 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## UPGRADE from 3.x to 4.0 | ||
|
||
### ResultPager | ||
|
||
* `\Github\ResultPagerInterface::postFetch` is deprecated, and the method will be removed from the ResultPager interface/class. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ | |
use GuzzleHttp\Psr7\Utils; | ||
use Http\Client\HttpClient; | ||
use Psr\Http\Client\ClientInterface; | ||
use Symfony\Bridge\PhpUnit\ExpectDeprecationTrait; | ||
|
||
/** | ||
* @author Ramon de la Fuente <[email protected]> | ||
|
@@ -21,6 +22,8 @@ | |
*/ | ||
class ResultPagerTest extends \PHPUnit\Framework\TestCase | ||
{ | ||
use ExpectDeprecationTrait; | ||
|
||
public function provideFetchCases() | ||
{ | ||
return [ | ||
|
@@ -197,4 +200,18 @@ public function testFetchAllWithoutKeys() | |
|
||
$this->assertCount(9, $result); | ||
} | ||
|
||
/** | ||
* @group legacy | ||
*/ | ||
public function testPostFetchDeprecation() | ||
{ | ||
$this->expectDeprecation('Since KnpLabs/php-github-api 3.2: The "Github\ResultPager::postFetch" method is deprecated and will be removed.'); | ||
|
||
$clientMock = $this->createMock(Client::class); | ||
$clientMock->method('getLastResponse')->willReturn(new PaginatedResponse(3, [])); | ||
|
||
$paginator = new ResultPager($clientMock); | ||
$paginator->postFetch(); | ||
} | ||
} |