Skip to content

Commit 095f6e2

Browse files
committed
Bump phpunit
1 parent a79740e commit 095f6e2

9 files changed

Lines changed: 39 additions & 26 deletions

File tree

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,12 @@
139139
"brainmaestro/composer-git-hooks": "^2.8",
140140
"extensions": {
141141
"phpunit/phpunit": {
142-
"fakerphp/faker": "1.20.*"
142+
"fakerphp/faker": "1.24.*"
143143
}
144144
},
145145
"friendsofphp/php-cs-fixer": "^3.3",
146146
"phpstan/phpstan": "^1.10",
147-
"phpunit/phpunit": "^9",
147+
"phpunit/phpunit": "^10",
148148
"rector/rector": "^1.0",
149149
"vimeo/psalm": "^5.23"
150150
}

phpunit.xml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false" bootstrap="./tests/bootstrap.php" colors="true" convertDeprecationsToExceptions="false" convertErrorsToExceptions="true" convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3-
<coverage processUncoveredFiles="true">
4-
<include>
5-
<directory suffix=".php">./src/</directory>
6-
</include>
7-
</coverage>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="./tests/bootstrap.php" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
3+
<coverage/>
84
<testsuites>
95
<testsuite name="BigBlueButton unit test suite">
106
<directory>./tests/unit/</directory>
@@ -16,4 +12,9 @@
1612
<directory>./tests/functional/</directory>
1713
</testsuite>
1814
</testsuites>
15+
<source>
16+
<include>
17+
<directory suffix=".php">./src</directory>
18+
</include>
19+
</source>
1920
</phpunit>

tests/integration/Http/Transport/CurlTransportTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public static function setUpBeforeClass(): void
4242
}
4343

4444
/** @return array<string,array<int>> */
45-
public function provideBadResponseCodes(): iterable
45+
public static function provideBadResponseCodes(): iterable
4646
{
4747
// cURL does not understand codes below 200 properly.
4848
// foreach (range(100, 199) as $badCode) {

tests/unit/Http/SetCookieTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public function testMatchesDomain(): void
150150
}
151151

152152
/** @return array<array<string|bool>> */
153-
public function pathMatchProvider(): array
153+
public static function pathMatchProvider(): array
154154
{
155155
return [
156156
['/foo', '/foo', true],
@@ -182,7 +182,7 @@ public function testMatchesPath(string $cookiePath, string $requestPath, bool $i
182182
}
183183

184184
/** @return array<array<string|bool>> */
185-
public function cookieValidateProvider(): array
185+
public static function cookieValidateProvider(): array
186186
{
187187
return [
188188
['foo', 'baz', 'bar', true],
@@ -240,7 +240,7 @@ public function testConvertsToString(): void
240240
*
241241
* @return array<mixed>
242242
*/
243-
public function cookieParserDataProvider(): array
243+
public static function cookieParserDataProvider(): array
244244
{
245245
return [
246246
[
@@ -442,7 +442,7 @@ public function testParseCookie(array|string $cookie, array $parsed): void
442442
*
443443
* @return array<array<string|bool>>
444444
*/
445-
public function isExpiredProvider(): array
445+
public static function isExpiredProvider(): array
446446
{
447447
return [
448448
[

tests/unit/Http/Transport/Bridge/PsrHttpClient/PsrHttpClientTransportTest.php

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -165,11 +165,23 @@ public function testRequestWithDefaultHeaders(): void
165165
$this->requestFactoryMock->expects($this->once())->method('createRequest')->with('POST', 'https://example.com/')->willReturn($requestMock);
166166
$this->streamFactoryMock->expects($this->once())->method('createStream')->with('Hi Doc!')->willReturn($requestStreamMock);
167167
$requestMock->expects($this->once())->method('withBody')->with($requestStreamMock)->willReturn($requestMock);
168-
$requestMock->expects($this->exactly(3))->method('withHeader')->withConsecutive(
169-
['X-A-Custom-Header', 'Foo'],
170-
['X-Another-Custom-Header', 'Bar'],
171-
['Content-Type', 'application/xml']
172-
)->willReturn($requestMock);
168+
$matcher = $this->exactly(3);
169+
$requestMock->expects($matcher)->method('withHeader')->willReturnCallback(function (...$parameters) use ($matcher, $requestMock) {
170+
if ($matcher->numberOfInvocations() === 1) {
171+
$this->assertSame('X-A-Custom-Header', $parameters[0]);
172+
$this->assertSame('Foo', $parameters[1]);
173+
}
174+
if ($matcher->numberOfInvocations() === 2) {
175+
$this->assertSame('X-Another-Custom-Header', $parameters[0]);
176+
$this->assertSame('Bar', $parameters[1]);
177+
}
178+
if ($matcher->numberOfInvocations() === 3) {
179+
$this->assertSame('Content-Type', $parameters[0]);
180+
$this->assertSame('application/xml', $parameters[1]);
181+
}
182+
183+
return $requestMock;
184+
});
173185
$this->httpClientMock->expects($this->once())->method('sendRequest')->with($requestMock)->willReturn($responseMock);
174186
$responseMock->expects($this->exactly(2))->method('getStatusCode')->willReturn(200);
175187
$responseMock->expects($this->once())->method('getHeader')->with('Set-Cookie')->willReturn(['JSESSIONID=MartyMcFlySession']);
@@ -199,7 +211,7 @@ public function testRequestWithClientException(): void
199211
}
200212

201213
/** @return iterable<string,array<int>> */
202-
public function provideBadResponseCodes(): iterable
214+
public static function provideBadResponseCodes(): iterable
203215
{
204216
foreach (range(100, 199) as $badCode) {
205217
yield 'HTTP code '.$badCode => [$badCode];

tests/unit/Http/Transport/Bridge/SymfonyHttpClient/SymfonyHttpClientTransportTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ public function testRequestWithDefaultOptions(): void
202202
}
203203

204204
/** @return iterable<string,array<int>> */
205-
public function provideBadResponseCodes(): iterable
205+
public static function provideBadResponseCodes(): iterable
206206
{
207207
foreach (range(100, 199) as $badCode) {
208208
yield 'HTTP code '.$badCode => [$badCode];
@@ -244,7 +244,7 @@ public function testRequestWithBadResponseCode(int $badCode): void
244244
}
245245

246246
/** @return iterable<string,array<int|FakeClientException|FakeServerException|FakeRedirectionException>> */
247-
public function provideBadResponseExceptions(): iterable
247+
public static function provideBadResponseExceptions(): iterable
248248
{
249249
yield 'Client exception' => [new FakeClientException(), 400];
250250
yield 'Server exception' => [new FakeServerException(), 500];

tests/unit/Http/Transport/HeaderTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public function testMergeCurlHeaders(): void
4949
/**
5050
* @return iterable<string[]>
5151
*/
52-
public function provideBadlyFormattedHeaders(): iterable
52+
public static function provideBadlyFormattedHeaders(): iterable
5353
{
5454
yield ['This is not valid.'];
5555
yield ['Foo:Bar'];
@@ -69,7 +69,7 @@ public function testMergeCurlHeadersWithBadHeaders(string $badHeader): void
6969
/**
7070
* @return iterable<mixed>
7171
*/
72-
public function provideNonStringHeaders(): iterable
72+
public static function provideNonStringHeaders(): iterable
7373
{
7474
yield [123];
7575
yield [false];

tests/unit/Util/ArrayHelperTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
final class ArrayHelperTest extends TestCase
3131
{
3232
/** @return iterable<string,array<string|array-key,string|bool>> */
33-
public function provideArrays(): iterable
33+
public static function provideArrays(): iterable
3434
{
3535
yield 'simple flat arrays' => [
3636
['foo' => 'bar', 'foo2' => 'bar2'],

tools/.phpunit/composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"require": {
3-
"phpunit/phpunit": "^9.0",
4-
"fakerphp/faker": "1.20.*"
3+
"phpunit/phpunit": "^10.0",
4+
"fakerphp/faker": "1.24.*"
55
}
66
}

0 commit comments

Comments
 (0)