Skip to content

Commit 88ce693

Browse files
committed
PHPUnit 12.5 #12152
1 parent 8eb9f2b commit 88ce693

15 files changed

+248
-341
lines changed

.php-cs-fixer.dist.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,8 @@
189189
'php_unit_assert_new_names' => true,
190190
'php_unit_attributes' => false, // Requires PHPUnit 10
191191
'php_unit_construct' => true,
192-
'php_unit_data_provider_method_order' => true,
193-
'php_unit_data_provider_name' => ['prefix' => 'provider', 'suffix' => ''],
192+
'php_unit_data_provider_method_order' => false, // In most cases, yes, but we still have a few exceptions of data providers shared across multiple tests
193+
'php_unit_data_provider_name' => false, // In most cases, yes, but we still have a few exceptions of data providers shared across multiple tests
194194
'php_unit_data_provider_return_type' => true,
195195
'php_unit_data_provider_static' => true,
196196
'php_unit_dedicate_assert' => true,

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,6 @@
6969
"mikey179/vfsstream": "@stable",
7070
"phpstan/phpstan": "@stable",
7171
"phpstan/phpstan-phpunit": "@stable",
72-
"phpunit/phpunit": "^11.5"
72+
"phpunit/phpunit": "@stable"
7373
}
7474
}

composer.lock

Lines changed: 229 additions & 322 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

phpstan-baseline.neon

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ parameters:
235235
path: tests/Service/ImagineFactoryTest.php
236236

237237
-
238-
message: '#^PHPDoc tag @var with type Doctrine\\ORM\\EntityManager is not subtype of native type PHPUnit\\Framework\\MockObject\\MockObject\.$#'
238+
message: '#^PHPDoc tag @var with type Doctrine\\ORM\\EntityManager is not subtype of native type PHPUnit\\Framework\\MockObject\\Stub\.$#'
239239
identifier: varTag.nativeType
240240
count: 1
241241
path: tests/Service/MailerTest.php

tests/Acl/Assertion/AllTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function testAssert(array $input, bool $expected): void
3535

3636
$assertion = new All(...$assertions);
3737

38-
$acl = $this->createMock(Acl::class);
38+
$acl = self::createStub(Acl::class);
3939
self::assertSame($expected, $assertion->assert($acl));
4040
}
4141

tests/Acl/Assertion/OneTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function testAssert(array $input, bool $expected): void
3535

3636
$assertion = new One(...$assertions);
3737

38-
$acl = $this->createMock(Acl::class);
38+
$acl = self::createStub(Acl::class);
3939
self::assertSame($expected, $assertion->assert($acl));
4040
}
4141

tests/Api/Scalar/AbstractDecimalTypeTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ protected function getMaximum(): ?string
4646
};
4747
}
4848

49-
#[DataProvider('providerInputs')]
49+
#[DataProvider('providerInputs', false)]
5050
public function testSerialize(int $decimal, ?string $minimum, ?string $maximum, null|float|int|string $input): void
5151
{
5252
$type = $this->createType($decimal, $minimum, $maximum);

tests/Api/Scalar/AbstractStringBasedType.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ abstract public function createType(): \Ecodev\Felix\Api\Scalar\AbstractStringBa
1616

1717
abstract public function getTypeName(): string;
1818

19-
#[DataProvider('providerValues')]
19+
#[DataProvider('providerValues', false)]
2020
public function testSerialize(?string $input, ?string $expected): void
2121
{
2222
$type = $this->createType();

tests/Handler/ImageHandlerTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ public function testWillServeOriginalWebpIfAccepted(): void
8181
$image = $this->createImageMock('vfs://felix/image.webp');
8282
$repository = $this->createRepositoryMock($image);
8383

84-
$imageResizer = $this->createMock(ImageResizer::class);
84+
$imageResizer = self::createStub(ImageResizer::class);
8585

8686
// A request specifically accepting webp images
8787
$request = new ServerRequest();
@@ -119,7 +119,7 @@ public function testWillServeOriginalJpgIfWebpNotAccepted(): void
119119
public function testWillErrorIfImageNotFoundInDatabase(): void
120120
{
121121
$repository = $this->createRepositoryMock(null);
122-
$imageResizer = $this->createMock(ImageResizer::class);
122+
$imageResizer = self::createStub(ImageResizer::class);
123123
$request = new ServerRequest();
124124

125125
$response = $this->handle($repository, $imageResizer, $request);
@@ -130,7 +130,7 @@ public function testWillErrorIfImageNotFoundOnDisk(): void
130130
{
131131
$image = $this->createImageMock('vfs://felix/totally-non-existing-path');
132132
$repository = $this->createRepositoryMock($image);
133-
$imageResizer = $this->createMock(ImageResizer::class);
133+
$imageResizer = self::createStub(ImageResizer::class);
134134
$request = new ServerRequest();
135135

136136
$response = $this->handle($repository, $imageResizer, $request);

tests/Log/LoggerFactoryTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ public function testWithMailHandler(): void
2727
{
2828
$container = new ServiceManager([
2929
'factories' => [
30-
DbHandler::class => fn () => $this->createMock(DbHandler::class),
31-
MailerHandler::class => fn () => $this->createMock(MailerHandler::class),
30+
DbHandler::class => fn () => self::createStub(DbHandler::class),
31+
MailerHandler::class => fn () => self::createStub(MailerHandler::class),
3232
],
3333
]);
3434

@@ -42,7 +42,7 @@ public function testWithoutMailHandler(): void
4242
{
4343
$container = new ServiceManager([
4444
'factories' => [
45-
DbHandler::class => fn () => $this->createMock(DbHandler::class),
45+
DbHandler::class => fn () => self::createStub(DbHandler::class),
4646
MailerHandler::class => fn () => null,
4747
],
4848
]);

0 commit comments

Comments
 (0)