Skip to content

Commit bc32889

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

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

src/HttpBaseTest.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ abstract class HttpBaseTest extends TestCase
3636
/**
3737
* @var array
3838
*/
39-
protected $defaultHeaders = [
39+
protected static $defaultHeaders = [
4040
'Connection' => 'close',
4141
'User-Agent' => 'PHP HTTP Adapter',
4242
'Content-Length' => '0',
@@ -98,7 +98,7 @@ public static function requestWithOutcomeProvider(): array
9898
return $cartesianProduct->compute();
9999
}
100100

101-
private function getMethods(): array
101+
private static function getMethods(): array
102102
{
103103
return [
104104
'GET',
@@ -116,7 +116,7 @@ private function getMethods(): array
116116
*
117117
* @return string|null
118118
*/
119-
protected function getUri(array $query = [])
119+
protected static function getUri(array $query = [])
120120
{
121121
return !empty($query)
122122
? PHPUnitUtility::getUri().'?'.http_build_query($query, '', '&')
@@ -134,25 +134,25 @@ protected function getInvalidUri()
134134
/**
135135
* @return array
136136
*/
137-
private function getUrisAndOutcomes()
137+
private static function getUrisAndOutcomes()
138138
{
139139
return [
140140
[
141-
$this->getUri(['client_error' => true]),
141+
self::getUri(['client_error' => true]),
142142
[
143143
'statusCode' => 400,
144144
'reasonPhrase' => 'Bad Request',
145145
],
146146
],
147147
[
148-
$this->getUri(['server_error' => true]),
148+
self::getUri(['server_error' => true]),
149149
[
150150
'statusCode' => 500,
151151
'reasonPhrase' => 'Internal Server Error',
152152
],
153153
],
154154
[
155-
$this->getUri(['redirect' => true]),
155+
self::getUri(['redirect' => true]),
156156
[
157157
'statusCode' => 302,
158158
'reasonPhrase' => 'Found',
@@ -165,41 +165,41 @@ private function getUrisAndOutcomes()
165165
/**
166166
* @return array
167167
*/
168-
private function getProtocolVersions()
168+
private static function getProtocolVersions()
169169
{
170170
return ['1.1', '1.0'];
171171
}
172172

173173
/**
174174
* @return string[]
175175
*/
176-
private function getHeaders()
176+
private static function getHeaders()
177177
{
178-
$headers = $this->defaultHeaders;
178+
$headers = self::$defaultHeaders;
179179
$headers['Accept-Charset'] = 'utf-8';
180180
$headers['Accept-Language'] = 'en';
181181

182182
return [
183-
$this->defaultHeaders,
183+
self::$defaultHeaders,
184184
$headers,
185185
];
186186
}
187187

188188
/**
189189
* @return array
190190
*/
191-
private function getBodies()
191+
private static function getBodies()
192192
{
193193
return [
194194
null,
195-
http_build_query($this->getData(), '', '&'),
195+
http_build_query(self::getData(), '', '&'),
196196
];
197197
}
198198

199199
/**
200200
* @return array
201201
*/
202-
private function getData()
202+
private static function getData()
203203
{
204204
return ['param1' => 'foo', 'param2' => ['bar', ['baz']]];
205205
}
@@ -223,7 +223,7 @@ protected function assertResponse(ResponseInterface $response, array $options =
223223
if (null === $options['body']) {
224224
$this->assertEmpty($response->getBody()->__toString());
225225
} else {
226-
$this->assertStringContainsStringCompatible($options['body'], $response->getBody()->__toString());
226+
self::assertStringContainsStringCompatible($options['body'], $response->getBody()->__toString());
227227
}
228228
}
229229

0 commit comments

Comments
 (0)