Skip to content

Commit

Permalink
PHP 8 support
Browse files Browse the repository at this point in the history
  • Loading branch information
jn-jairo committed Sep 1, 2021
1 parent 18a9c29 commit a3ea393
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ matrix:
- php: 7.4
- php: 7.4
env: setup=lowest
- php: 8.0

sudo: false

Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG-2.x.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# Changelog

## [Unreleased](https://github.com/jn-jairo/laravel-ngrok/compare/v2.0.0...2.x)
## [Unreleased](https://github.com/jn-jairo/laravel-ngrok/compare/v2.0.1...2.x)

## [v2.0.1 (2021-09-01)](https://github.com/jn-jairo/laravel-ngrok/compare/v2.0.0...v2.0.1)

### Added
- PHP 8 support

## [v2.0.0 (2020-09-09)](https://github.com/jn-jairo/laravel-ngrok/compare/v1.0.1...v2.0.0)

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
}
],
"require": {
"php": "^7.3",
"php": "^7.3|^8.0",
"guzzlehttp/guzzle": "^6.3|^7.0|^8.0",
"illuminate/console": "^6.0|^7.0|^8.0",
"illuminate/http": "^6.0|^7.0|^8.0",
Expand Down
16 changes: 13 additions & 3 deletions tests/NgrokWebServiceTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use JnJairo\Laravel\Ngrok\NgrokWebService;
use JnJairo\Laravel\Ngrok\Tests\TestCase;
use Prophecy\PhpUnit\ProphecyTrait;
use Psr\Http\Message\StreamInterface;

/**
* @testdox Ngrok web service
Expand All @@ -28,8 +29,11 @@ public function test_get_tunnels() : void
],
];

$stream = $this->prophesize(StreamInterface::class);
$stream->__toString()->willReturn(json_encode(['tunnels' => $tunnels]))->shouldBeCalled();

$response = $this->prophesize(Response::class);
$response->getBody()->willReturn(json_encode(['tunnels' => $tunnels]))->shouldBeCalled();
$response->getBody()->willReturn($stream->reveal())->shouldBeCalled();

$httpClient = $this->prophesize(Client::class);
$httpClient->request(
Expand All @@ -47,8 +51,11 @@ public function test_get_tunnels_empty() : void
{
$tunnels = [];

$stream = $this->prophesize(StreamInterface::class);
$stream->__toString()->willReturn(json_encode(['tunnels' => $tunnels]))->shouldBeCalled();

$response = $this->prophesize(Response::class);
$response->getBody()->willReturn(json_encode(['tunnels' => $tunnels]))->shouldBeCalled();
$response->getBody()->willReturn($stream->reveal())->shouldBeCalled();

$httpClient = $this->prophesize(Client::class);
$httpClient->request(
Expand All @@ -66,8 +73,11 @@ public function test_get_tunnels_invalid_json() : void
{
$tunnels = [];

$stream = $this->prophesize(StreamInterface::class);
$stream->__toString()->willReturn('')->shouldBeCalled();

$response = $this->prophesize(Response::class);
$response->getBody()->willReturn('')->shouldBeCalled();
$response->getBody()->willReturn($stream->reveal())->shouldBeCalled();

$httpClient = $this->prophesize(Client::class);
$httpClient->request(
Expand Down

0 comments on commit a3ea393

Please sign in to comment.