Skip to content

Commit

Permalink
Fixed L11 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Sammyjo20 committed Mar 13, 2024
1 parent 23f3bd4 commit ecd2584
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 25 deletions.
1 change: 1 addition & 0 deletions .phpunit.cache/test-results
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":"pest_2.34.2","defects":[],"times":{"P\\Tests\\Feature\\AsyncRequestTest::__pest_evaluable_an_asynchronous_request_can_be_made_successfully":0.234,"P\\Tests\\Feature\\AsyncRequestTest::__pest_evaluable_an_asynchronous_request_can_handle_an_exception_properly":0.21,"P\\Tests\\Feature\\AsyncRequestTest::__pest_evaluable_an_asynchronous_response_will_still_be_passed_through_response_middleware":0.014,"P\\Tests\\Feature\\AsyncRequestTest::__pest_evaluable_an_asynchronous_request_will_return_a_custom_response":0.004,"P\\Tests\\Feature\\Body\\HasBodyTest::__pest_evaluable_the_default_body_is_loaded":0.002,"P\\Tests\\Feature\\Body\\HasBodyTest::__pest_evaluable_the_http_sender_properly_sends_it":0.001,"P\\Tests\\Feature\\Body\\HasFormBodyTest::__pest_evaluable_the_default_body_is_loaded":0.001,"P\\Tests\\Feature\\Body\\HasFormBodyTest::__pest_evaluable_the_http_sender_properly_sends_it":0.001,"P\\Tests\\Feature\\Body\\HasJsonBodyTest::__pest_evaluable_the_default_body_is_loaded":0.001,"P\\Tests\\Feature\\Body\\HasJsonBodyTest::__pest_evaluable_the_content_type_header_is_set_in_the_pending_request":0,"P\\Tests\\Feature\\Body\\HasJsonBodyTest::__pest_evaluable_the_http_sender_properly_sends_it":0.001,"P\\Tests\\Feature\\Body\\HasMultipartBodyTest::__pest_evaluable_the_default_body_is_loaded":0.003,"P\\Tests\\Feature\\Body\\HasMultipartBodyTest::__pest_evaluable_the_http_sender_properly_sends_it":0.005,"P\\Tests\\Feature\\Body\\HasXmlBodyTest::__pest_evaluable_the_default_body_is_loaded":0.001,"P\\Tests\\Feature\\Body\\HasXmlBodyTest::__pest_evaluable_the_content_type_header_is_set_in_the_pending_request":0,"P\\Tests\\Feature\\Body\\HasXmlBodyTest::__pest_evaluable_the_http_sender_properly_sends_it":0.001,"P\\Tests\\Feature\\ConfigTest::__pest_evaluable_default_guzzle_config_options_are_sent":0.001,"P\\Tests\\Feature\\ConfigTest::__pest_evaluable_you_can_pass_additional_guzzle_config_options_and_they_are_merged_from_the_connector_and_request":0.001,"P\\Tests\\Feature\\ConfigTest::__pest_evaluable_you_can_pass_additional_headers_that_will_be_merged_with_the_default_headers_from_the_psr_request":0.001,"P\\Tests\\Feature\\GlobalMiddlewareTest::__pest_evaluable_the_global_middleware_of_the_http_client_factory_is_also_applied_to_saloon_requests":0.143,"P\\Tests\\Feature\\HttpEventsTest::__pest_evaluable_the_http_events_are_fired_when_using_the_http_sender":0.275,"P\\Tests\\Feature\\HttpEventsTest::__pest_evaluable_the_http_events_are_fired_when_using_the_http_sender_with_asynchronous_events":0.296,"P\\Tests\\Feature\\HttpEventsTest::__pest_evaluable_the_http_events_are_fired_when_using_request_pools":0.239,"P\\Tests\\Feature\\PoolTest::__pest_evaluable_you_can_create_a_pool_on_a_connector":0.222,"P\\Tests\\Feature\\PoolTest::__pest_evaluable_if_a_pool_has_a_request_that_cannot_connect_it_will_be_caught_in_the_handleException_callback":0.006,"P\\Tests\\Feature\\RequestTest::__pest_evaluable_a_request_can_be_made_successfully":0.148,"P\\Tests\\Feature\\RequestTest::__pest_evaluable_a_request_can_handle_an_exception_properly":0.102,"P\\Tests\\Feature\\RequestTest::__pest_evaluable_a_request_will_throw_an_exception_if_a_connection_error_happens":0.002}}
8 changes: 4 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
"homepage": "https://github.com/sammyjo20",
"require": {
"php": "^8.1",
"illuminate/http": "^10.32|^11.0",
"illuminate/http": "^10.32 || ^11.0",
"saloonphp/saloon": "^3.1"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.5",
"pestphp/pest": "^1.23|^2.34",
"orchestra/testbench": "^8.0 || ^9.0",
"pestphp/pest": "^1.23 || ^2.34",
"phpstan/phpstan": "^1.9",
"spatie/ray": "^1.33",
"orchestra/testbench": "^8.0|^9.0"
"spatie/ray": "^1.33"
},
"minimum-stability": "stable",
"autoload": {
Expand Down
28 changes: 12 additions & 16 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="./vendor/phpunit/phpunit/phpunit.xsd"
bootstrap="vendor/autoload.php"
colors="true"
>
<testsuites>
<testsuite name="Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<coverage processUncoveredFiles="true">
<include>
<directory suffix=".php">./app</directory>
<directory suffix=".php">./src</directory>
</include>
</coverage>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" bootstrap="vendor/autoload.php" colors="true" cacheDirectory=".phpunit.cache">
<testsuites>
<testsuite name="Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<source>
<include>
<directory suffix=".php">./app</directory>
<directory suffix=".php">./src</directory>
</include>
</source>
</phpunit>
6 changes: 3 additions & 3 deletions src/HttpSender.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ protected function processPromise(RequestInterface $psrRequest, PromiseInterface
// it back down the "otherwise"/"catch" chain

return $promise
->then(function (HttpResponse|TransferException $result) {
$exception = $result instanceof TransferException ? $result : $result->toException();
->then(function (HttpResponse|TransferException|ConnectionException $result) {
$exception = $result instanceof TransferException || $result instanceof ConnectionException ? $result : $result->toException();

if ($exception instanceof Throwable) {
throw $exception;
Expand All @@ -114,7 +114,7 @@ function (HttpResponse $response) use ($psrRequest, $pendingRequest) {
},
)
->otherwise(
function (HttpRequestException|TransferException $exception) use ($pendingRequest, $psrRequest) {
function (HttpRequestException|TransferException|ConnectionException $exception) use ($pendingRequest, $psrRequest) {
// When the exception wasn't a HttpRequestException, we'll throw a fatal
// exception as this is likely a ConnectException, but it will
// catch any new ones Guzzle release.
Expand Down
3 changes: 2 additions & 1 deletion tests/Feature/PoolTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types=1);

use Illuminate\Http\Client\ConnectionException;
use Saloon\Http\Response;
use Saloon\Http\PendingRequest;
use Saloon\HttpSender\HttpSender;
Expand Down Expand Up @@ -64,7 +65,7 @@

$pool->withExceptionHandler(function (FatalRequestException $ex) use (&$count) {
expect($ex)->toBeInstanceOf(FatalRequestException::class);
expect($ex->getPrevious())->toBeInstanceOf(ConnectException::class);
expect($ex->getPrevious())->toBeInstanceOf(ConnectionException::class);
expect($ex->getPendingRequest())->toBeInstanceOf(PendingRequest::class);

$count++;
Expand Down
4 changes: 3 additions & 1 deletion tests/Feature/RequestTest.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
¬<?php
<?php

declare(strict_types=1);

use Saloon\HttpSender\HttpSender;
use Saloon\Exceptions\Request\FatalRequestException;
Expand Down

0 comments on commit ecd2584

Please sign in to comment.