Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.1.3] - 2025-12-08

- Fixed BC breaks accidentally introduced in 3.1.2

## [3.1.2] - 2025-12-08

Expand Down
8 changes: 4 additions & 4 deletions src/HttpAsyncClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ public function testSuccessiveCallMustUseResponseInterface()
{
$request = self::$messageFactory->createRequest(
'GET',
self::getUri(),
self::$defaultHeaders
$this->getUri(),
$this->defaultHeaders
);

$promise = $this->httpAsyncClient->sendAsyncRequest($request);
Expand All @@ -63,7 +63,7 @@ public function testSuccessiveInvalidCallMustUseException()
$request = self::$messageFactory->createRequest(
'GET',
$this->getInvalidUri(),
self::$defaultHeaders
$this->defaultHeaders
);

$promise = $this->httpAsyncClient->sendAsyncRequest($request);
Expand Down Expand Up @@ -136,7 +136,7 @@ public function testSendAsyncWithInvalidUri()
$request = self::$messageFactory->createRequest(
'GET',
$this->getInvalidUri(),
self::$defaultHeaders
$this->defaultHeaders
);

$exception = null;
Expand Down
48 changes: 24 additions & 24 deletions src/HttpBaseTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ abstract class HttpBaseTest extends TestCase
/**
* @var array
*/
protected static $defaultHeaders = [
protected $defaultHeaders = [
'Connection' => 'close',
'User-Agent' => 'PHP HTTP Adapter',
'Content-Length' => '0',
Expand All @@ -59,13 +59,13 @@ public static function tearDownAfterClass(): void
}
}

public static function requestProvider(): array
public function requestProvider(): array
{
$sets = [
'methods' => self::getMethods(),
'uris' => [self::getUri()],
'headers' => self::getHeaders(),
'body' => self::getBodies(),
'methods' => $this->getMethods(),
'uris' => [$this->getUri()],
'headers' => $this->getHeaders(),
'body' => $this->getBodies(),
];

$cartesianProduct = new CartesianProduct($sets);
Expand All @@ -82,21 +82,21 @@ public static function requestProvider(): array
});
}

public static function requestWithOutcomeProvider(): array
public function requestWithOutcomeProvider(): array
{
$sets = [
'urisAndOutcomes' => self::getUrisAndOutcomes(),
'protocolVersions' => self::getProtocolVersions(),
'headers' => self::getHeaders(),
'body' => self::getBodies(),
'urisAndOutcomes' => $this->getUrisAndOutcomes(),
'protocolVersions' => $this->getProtocolVersions(),
'headers' => $this->getHeaders(),
'body' => $this->getBodies(),
];

$cartesianProduct = new CartesianProduct($sets);

return $cartesianProduct->compute();
}

private static function getMethods(): array
private function getMethods(): array
{
return [
'GET',
Expand All @@ -114,7 +114,7 @@ private static function getMethods(): array
*
* @return string|null
*/
protected static function getUri(array $query = [])
protected function getUri(array $query = [])
{
return !empty($query)
? PHPUnitUtility::getUri().'?'.http_build_query($query, '', '&')
Expand All @@ -132,25 +132,25 @@ protected function getInvalidUri()
/**
* @return array
*/
private static function getUrisAndOutcomes()
private function getUrisAndOutcomes()
{
return [
[
self::getUri(['client_error' => true]),
$this->getUri(['client_error' => true]),
[
'statusCode' => 400,
'reasonPhrase' => 'Bad Request',
],
],
[
self::getUri(['server_error' => true]),
$this->getUri(['server_error' => true]),
[
'statusCode' => 500,
'reasonPhrase' => 'Internal Server Error',
],
],
[
self::getUri(['redirect' => true]),
$this->getUri(['redirect' => true]),
[
'statusCode' => 302,
'reasonPhrase' => 'Found',
Expand All @@ -163,41 +163,41 @@ private static function getUrisAndOutcomes()
/**
* @return array
*/
private static function getProtocolVersions()
private function getProtocolVersions()
{
return ['1.1', '1.0'];
}

/**
* @return string[]
*/
private static function getHeaders()
private function getHeaders()
{
$headers = self::$defaultHeaders;
$headers = $this->defaultHeaders;
$headers['Accept-Charset'] = 'utf-8';
$headers['Accept-Language'] = 'en';

return [
self::$defaultHeaders,
$this->defaultHeaders,
$headers,
];
}

/**
* @return array
*/
private static function getBodies()
private function getBodies()
{
return [
null,
http_build_query(self::getData(), '', '&'),
http_build_query($this->getData(), '', '&'),
];
}

/**
* @return array
*/
private static function getData()
private function getData()
{
return ['param1' => 'foo', 'param2' => ['bar', ['baz']]];
}
Expand Down
2 changes: 1 addition & 1 deletion src/HttpClientTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public function testSendWithInvalidUri()
$request = self::$messageFactory->createRequest(
'GET',
$this->getInvalidUri(),
self::$defaultHeaders
$this->defaultHeaders
);

$this->expectException(NetworkExceptionInterface::class);
Expand Down
Loading