diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83e62d87e29..175c5f09a0e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - php-versions: ['7.2', '7.3', '7.4', '8.0'] + php-versions: ['7.2', '7.3', '7.4', '8.0', '8.1'] steps: - uses: actions/checkout@v2 diff --git a/test/Github/Tests/Api/PullRequestTest.php b/test/Github/Tests/Api/PullRequestTest.php index 90505535ff9..fe5b87c9d6d 100644 --- a/test/Github/Tests/Api/PullRequestTest.php +++ b/test/Github/Tests/Api/PullRequestTest.php @@ -144,15 +144,15 @@ public function shouldShowStatusesFromPullRequest() $expectedArray['_links']['statuses']['href'] = '/repos/ezsystems/ezpublish/pulls/15/statuses'; $api = $this->getApiMock(); - $api->expects($this->at(0)) - ->method('get') - ->with('/repos/ezsystems/ezpublish/pulls/15') - ->will($this->returnValue($expectedArray)); - $api->expects($this->at(1)) + $api->expects($this->exactly(2)) ->method('get') - ->with('/repos/ezsystems/ezpublish/pulls/15/statuses') - ->will($this->returnValue($expectedArray)); + ->withConsecutive( + [$this->equalTo('/repos/ezsystems/ezpublish/pulls/15')], + [$this->equalTo('/repos/ezsystems/ezpublish/pulls/15/statuses')] + ) + ->willReturn($expectedArray) + ; $this->assertEquals($expectedArray, $api->status('ezsystems', 'ezpublish', '15')); } diff --git a/test/Github/Tests/HttpClient/Plugin/GithubExceptionThrowerTest.php b/test/Github/Tests/HttpClient/Plugin/GithubExceptionThrowerTest.php index 4f6f9a5615b..99973521980 100644 --- a/test/Github/Tests/HttpClient/Plugin/GithubExceptionThrowerTest.php +++ b/test/Github/Tests/HttpClient/Plugin/GithubExceptionThrowerTest.php @@ -4,6 +4,7 @@ use Github\Exception\ExceptionInterface; use Github\HttpClient\Plugin\GithubExceptionThrower; +use GuzzleHttp\Psr7\Request; use GuzzleHttp\Psr7\Response; use Http\Client\Promise\HttpFulfilledPromise; use Http\Client\Promise\HttpRejectedPromise; @@ -17,14 +18,11 @@ class GithubExceptionThrowerTest extends TestCase { /** - * @param ResponseInterface $response - * @param ExceptionInterface|\Exception|null $exception * @dataProvider responseProvider */ - public function testHandleRequest(ResponseInterface $response, ExceptionInterface $exception = null) + public function testHandleRequest(ResponseInterface $response, ExceptionInterface $exception = null): void { - /** @var RequestInterface $request */ - $request = $this->getMockForAbstractClass(RequestInterface::class); + $request = new Request('GET', 'https://api.github.com/issues'); $promise = new HttpFulfilledPromise($response);