Skip to content

Commit dc1e281

Browse files
committed
feat: allow PHPUnit 10-11
1 parent 2379acf commit dc1e281

File tree

3 files changed

+25
-11
lines changed

3 files changed

+25
-11
lines changed

src/HttpAsyncClientTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
namespace Http\Client\Tests;
44

55
use Http\Client\HttpAsyncClient;
6+
use PHPUnit\Framework\Attributes\DataProvider;
7+
use PHPUnit\Framework\Attributes\Group;
68

79
abstract class HttpAsyncClientTest extends HttpBaseTest
810
{
@@ -90,6 +92,8 @@ public function testSuccessiveInvalidCallMustUseException()
9092
* @dataProvider requestProvider
9193
* @group integration
9294
*/
95+
#[DataProvider('requestProvider')]
96+
#[Group('integration')]
9397
public function testAsyncSendRequest($method, $uri, array $headers, $body)
9498
{
9599
if (null != $body) {
@@ -124,8 +128,9 @@ public function testAsyncSendRequest($method, $uri, array $headers, $body)
124128
}
125129

126130
/**
127-
* @group integration
131+
* @group integration
128132
*/
133+
#[Group('integration')]
129134
public function testSendAsyncWithInvalidUri()
130135
{
131136
$request = self::$messageFactory->createRequest(
@@ -159,6 +164,8 @@ public function testSendAsyncWithInvalidUri()
159164
* @dataProvider requestWithOutcomeProvider
160165
* @group integration
161166
*/
167+
#[Group('integration')]
168+
#[DataProvider('requestWithOutcomeProvider')]
162169
public function testSendAsyncRequestWithOutcome($uriAndOutcome, $protocolVersion, array $headers, $body)
163170
{
164171
if ('1.0' === $protocolVersion) {

src/HttpBaseTest.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ public static function tearDownAfterClass(): void
6161
}
6262
}
6363

64-
public function requestProvider(): array
64+
public static function requestProvider(): array
6565
{
6666
$sets = [
67-
'methods' => $this->getMethods(),
68-
'uris' => [$this->getUri()],
69-
'headers' => $this->getHeaders(),
70-
'body' => $this->getBodies(),
67+
'methods' => self::getMethods(),
68+
'uris' => [self::getUri()],
69+
'headers' => self::getHeaders(),
70+
'body' => self::getBodies(),
7171
];
7272

7373
$cartesianProduct = new CartesianProduct($sets);
@@ -84,13 +84,13 @@ public function requestProvider(): array
8484
});
8585
}
8686

87-
public function requestWithOutcomeProvider(): array
87+
public static function requestWithOutcomeProvider(): array
8888
{
8989
$sets = [
90-
'urisAndOutcomes' => $this->getUrisAndOutcomes(),
91-
'protocolVersions' => $this->getProtocolVersions(),
92-
'headers' => $this->getHeaders(),
93-
'body' => $this->getBodies(),
90+
'urisAndOutcomes' => self::getUrisAndOutcomes(),
91+
'protocolVersions' => self::getProtocolVersions(),
92+
'headers' => self::getHeaders(),
93+
'body' => self::getBodies(),
9494
];
9595

9696
$cartesianProduct = new CartesianProduct($sets);

src/HttpClientTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace Http\Client\Tests;
44

5+
use PHPUnit\Framework\Attributes\DataProvider;
6+
use PHPUnit\Framework\Attributes\Group;
57
use Psr\Http\Client\ClientInterface;
68
use Psr\Http\Client\NetworkExceptionInterface;
79

@@ -37,6 +39,8 @@ abstract protected function createHttpAdapter(): ClientInterface;
3739
* @dataProvider requestProvider
3840
* @group integration
3941
*/
42+
#[Group('integration')]
43+
#[DataProvider('requestProvider')]
4044
public function testSendRequest($method, $uri, array $headers, $body)
4145
{
4246
if (null != $body) {
@@ -65,6 +69,8 @@ public function testSendRequest($method, $uri, array $headers, $body)
6569
* @dataProvider requestWithOutcomeProvider
6670
* @group integration
6771
*/
72+
#[Group('integration')]
73+
#[DataProvider('requestWithOutcomeProvider')]
6874
public function testSendRequestWithOutcome($uriAndOutcome, $protocolVersion, array $headers, $body)
6975
{
7076
if ('1.0' === $protocolVersion) {
@@ -95,6 +101,7 @@ public function testSendRequestWithOutcome($uriAndOutcome, $protocolVersion, arr
95101
/**
96102
* @group integration
97103
*/
104+
#[Group('integration')]
98105
public function testSendWithInvalidUri()
99106
{
100107
$request = self::$messageFactory->createRequest(

0 commit comments

Comments
 (0)