Skip to content

Commit 09ef415

Browse files
committed
upgrade to integration tests 4
1 parent 94290f4 commit 09ef415

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
needs:
2525
- supported-versions-matrix
2626
strategy:
27+
fail-fast: false
2728
matrix:
2829
php: ${{ fromJson(needs.supported-versions-matrix.outputs.version) }}
2930

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
},
1919
"require-dev": {
2020
"friendsofphp/php-cs-fixer": "^3.51",
21-
"php-http/client-integration-tests": "^3.1.1",
21+
"php-http/client-integration-tests": "dev-cleanup-major",
2222
"php-http/message": "^1.16",
2323
"php-http/client-common": "^2.7",
24-
"phpunit/phpunit": "^8.5.23 || ~9.5",
24+
"phpunit/phpunit": "^11.0 || ^12.0",
2525
"php-http/message-factory": "^1.1"
2626
},
2727
"provide": {

src/Client.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ class Client implements HttpClient
2828
use ResponseReader;
2929

3030
/**
31-
* @var array{remote_socket: string|null, timeout: int, stream_context: resource, stream_context_options: array<string, mixed>, stream_context_param: array<string, mixed>, ssl: ?boolean, write_buffer_size: int, ssl_method: int}
31+
* @var array{remote_socket: string|null, timeout: int, stream_context: resource, stream_context_options: array<string, mixed>, stream_context_param: array<string, mixed>, ssl: ?bool, write_buffer_size: int, ssl_method: int}
3232
*/
3333
private $config;
3434

3535
/**
3636
* Constructor.
3737
*
38-
* @param array{remote_socket?: string|null, timeout?: int, stream_context?: resource, stream_context_options?: array<string, mixed>, stream_context_param?: array<string, mixed>, ssl?: ?boolean, write_buffer_size?: int, ssl_method?: int}|ResponseFactoryInterface $config1
39-
* @param array{remote_socket?: string|null, timeout?: int, stream_context?: resource, stream_context_options?: array<string, mixed>, stream_context_param?: array<string, mixed>, ssl?: ?boolean, write_buffer_size?: int, ssl_method?: int}|null $config2 Mistake when refactoring the constructor from version 1 to version 2 - used as $config if set and $configOrResponseFactory is a response factory instance
40-
* @param array{remote_socket?: string|null, timeout?: int, stream_context?: resource, stream_context_options?: array<string, mixed>, stream_context_param?: array<string, mixed>, ssl?: ?boolean, write_buffer_size?: int, ssl_method?: int} $config intended for version 1 BC, used as $config if $config2 is not set and $configOrResponseFactory is a response factory instance
38+
* @param array{remote_socket?: string|null, timeout?: int, stream_context?: resource, stream_context_options?: array<string, mixed>, stream_context_param?: array<string, mixed>, ssl?: ?bool, write_buffer_size?: int, ssl_method?: int}|ResponseFactoryInterface $config1
39+
* @param array{remote_socket?: string|null, timeout?: int, stream_context?: resource, stream_context_options?: array<string, mixed>, stream_context_param?: array<string, mixed>, ssl?: ?bool, write_buffer_size?: int, ssl_method?: int}|null $config2 Mistake when refactoring the constructor from version 1 to version 2 - used as $config if set and $configOrResponseFactory is a response factory instance
40+
* @param array{remote_socket?: string|null, timeout?: int, stream_context?: resource, stream_context_options?: array<string, mixed>, stream_context_param?: array<string, mixed>, ssl?: ?bool, write_buffer_size?: int, ssl_method?: int} $config intended for version 1 BC, used as $config if $config2 is not set and $configOrResponseFactory is a response factory instance
4141
*
4242
* string|null remote_socket Remote entrypoint (can be a tcp or unix domain address)
4343
* int timeout Timeout before canceling request
@@ -141,9 +141,9 @@ protected function closeSocket($socket)
141141
/**
142142
* Return configuration for the socket client.
143143
*
144-
* @param array{remote_socket?: string|null, timeout?: int, stream_context?: resource, stream_context_options?: array<string, mixed>, stream_context_param?: array<string, mixed>, ssl?: ?boolean, write_buffer_size?: int, ssl_method?: int} $config
144+
* @param array{remote_socket?: string|null, timeout?: int, stream_context?: resource, stream_context_options?: array<string, mixed>, stream_context_param?: array<string, mixed>, ssl?: ?bool, write_buffer_size?: int, ssl_method?: int} $config
145145
*
146-
* @return array{remote_socket: string|null, timeout: int, stream_context: resource, stream_context_options: array<string, mixed>, stream_context_param: array<string, mixed>, ssl: ?boolean, write_buffer_size: int, ssl_method: int}
146+
* @return array{remote_socket: string|null, timeout: int, stream_context: resource, stream_context_options: array<string, mixed>, stream_context_param: array<string, mixed>, ssl: ?bool, write_buffer_size: int, ssl_method: int}
147147
*/
148148
protected function configure(array $config = [])
149149
{

tests/SocketHttpClientTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,16 @@
77
use Http\Client\Socket\Exception\NetworkException;
88
use Http\Client\Socket\Exception\TimeoutException;
99
use Nyholm\Psr7\Factory\Psr17Factory;
10+
use Psr\Http\Message\ResponseInterface;
1011

1112
class SocketHttpClientTest extends BaseTestCase
1213
{
13-
public function createClient($options = [])
14+
public function createClient($options = []): HttpMethodsClient
1415
{
1516
return new HttpMethodsClient(new SocketHttpClient($options), new Psr17Factory());
1617
}
1718

18-
public function testTcpSocketDomain()
19+
public function testTcpSocketDomain(): void
1920
{
2021
$this->startServer('tcp-server');
2122
$client = $this->createClient(['remote_socket' => '127.0.0.1:19999']);
@@ -73,7 +74,7 @@ public function testSslRemoteInUri(): void
7374
]);
7475
$response = $client->get('/', []);
7576

76-
$this->assertInstanceOf('Psr\Http\Message\ResponseInterface', $response);
77+
$this->assertInstanceOf(ResponseInterface::class, $response);
7778
$this->assertEquals(200, $response->getStatusCode());
7879
}
7980

0 commit comments

Comments
 (0)