Skip to content

Commit

Permalink
- Fix error warning for client_handles_http_client_exceptions.
Browse files Browse the repository at this point in the history
- Add robiningelbrecht/phpunit-pretty-print to dev deps.
  • Loading branch information
IndexZer0 committed Feb 28, 2024
1 parent 35cdb88 commit 21c8d4a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"laravel/pint": "^1.0",
"php-http/mock-client": "^1.6",
"phpunit/phpunit": "^11.0",
"robiningelbrecht/phpunit-pretty-print": "^1.3",
"spatie/ray": "^1.28"
},
"autoload": {
Expand Down
4 changes: 4 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,8 @@
<directory suffix=".php">./src</directory>
</include>
</source>
<extensions>
<bootstrap class="RobinIngelbrecht\PHPUnitPrettyPrint\PhpUnitExtension">
</bootstrap>
</extensions>
</phpunit>
4 changes: 2 additions & 2 deletions tests/HaRestApiClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@

use DateTime;
use DateTimeInterface;
use Exception;
use Generator;
use GuzzleHttp\Handler\MockHandler;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Middleware;
use Http\Client\Common\Exception\HttpClientNotFoundException;
use Http\Mock\Client;
use IndexZer0\HaRestApiClient\Exception\HaExceptionInterface;
use IndexZer0\HaRestApiClient\HaRestApiClient;
Expand Down Expand Up @@ -942,7 +942,7 @@ public function client_handles_http_client_exceptions(): void
{
// Arrange
$message = 'Http Client Exception';
$this->mockClient->addException(new Exception($message));
$this->mockClient->addException(new HttpClientNotFoundException($message));

$client = $this->createClient($this->defaultBearerToken, $this->defaultBaseUri);

Expand Down

0 comments on commit 21c8d4a

Please sign in to comment.