Skip to content

Commit b969792

Browse files
minor #61390 run tests with PHPUnit 12.3 (xabbuh)
This PR was merged into the 7.4 branch. Discussion ---------- run tests with PHPUnit 12.3 | Q | A | ------------- | --- | Branch? | 7.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | | License | MIT The test updates reflect the following changes in PHPUnit 12.2 and 12.3: - a warning is emitted when a data provider provides data sets that have more values than the test method consuming the data set - the format in which data sets are displayed in test reports has changed affecting the modified test in the PhpUnitBridge (see sebastianbergmann/phpunit#6272) - errors triggered in the `tearDown()` method of skipped tests are no longer silence affecting the modified tests in the Form component where the `$defaultLocale` property is not initialised (see sebastianbergmann/phpunit#6281) Commits ------- cf7e41e run tests with PHPUnit 12.3
2 parents 3b7a33f + cf7e41e commit b969792

File tree

32 files changed

+238
-217
lines changed

32 files changed

+238
-217
lines changed

phpunit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if (!file_exists(__DIR__.'/vendor/symfony/phpunit-bridge/bin/simple-phpunit')) {
77
}
88
if (!getenv('SYMFONY_PHPUNIT_VERSION')) {
99
if (\PHP_VERSION_ID >= 80300) {
10-
putenv('SYMFONY_PHPUNIT_VERSION=12.1');
10+
putenv('SYMFONY_PHPUNIT_VERSION=12.3');
1111
} else {
1212
putenv('SYMFONY_PHPUNIT_VERSION=11.5');
1313
}

src/Symfony/Bridge/PhpUnit/Tests/symfonyextensionnotregistered.phpt

Lines changed: 75 additions & 75 deletions
Large diffs are not rendered by default.

src/Symfony/Bridge/Twig/Tests/Extension/HttpFoundationExtensionTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function testGenerateAbsoluteUrlWithRequestContext($path, $baseUrl, $host
6464
}
6565

6666
#[DataProvider('getGenerateAbsoluteUrlRequestContextData')]
67-
public function testGenerateAbsoluteUrlWithoutRequestAndRequestContext($path)
67+
public function testGenerateAbsoluteUrlWithoutRequestAndRequestContext($path, $baseUrl, $host, $scheme, $httpPort, $httpsPort, $expected)
6868
{
6969
$extension = new HttpFoundationExtension(new UrlHelper(new RequestStack()));
7070

src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/AbstractDescriptorTestCase.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ protected function tearDown(): void
4343
}
4444

4545
#[DataProvider('getDescribeRouteCollectionTestData')]
46-
public function testDescribeRouteCollection(RouteCollection $routes, $expectedDescription)
46+
public function testDescribeRouteCollection(RouteCollection $routes, $expectedDescription, $file)
4747
{
4848
$this->assertDescription($expectedDescription, $routes);
4949
}
@@ -54,7 +54,7 @@ public static function getDescribeRouteCollectionTestData(): array
5454
}
5555

5656
#[DataProvider('getDescribeRouteCollectionWithHttpMethodFilterTestData')]
57-
public function testDescribeRouteCollectionWithHttpMethodFilter(string $httpMethod, RouteCollection $routes, $expectedDescription)
57+
public function testDescribeRouteCollectionWithHttpMethodFilter(string $httpMethod, RouteCollection $routes, $expectedDescription, $file)
5858
{
5959
$this->assertDescription($expectedDescription, $routes, ['method' => $httpMethod]);
6060
}
@@ -69,7 +69,7 @@ public static function getDescribeRouteCollectionWithHttpMethodFilterTestData():
6969
}
7070

7171
#[DataProvider('getDescribeRouteTestData')]
72-
public function testDescribeRoute(Route $route, $expectedDescription)
72+
public function testDescribeRoute(Route $route, $expectedDescription, $file)
7373
{
7474
$this->assertDescription($expectedDescription, $route);
7575
}
@@ -80,7 +80,7 @@ public static function getDescribeRouteTestData(): array
8080
}
8181

8282
#[DataProvider('getDescribeContainerParametersTestData')]
83-
public function testDescribeContainerParameters(ParameterBag $parameters, $expectedDescription)
83+
public function testDescribeContainerParameters(ParameterBag $parameters, $expectedDescription, $file)
8484
{
8585
$this->assertDescription($expectedDescription, $parameters);
8686
}
@@ -91,7 +91,7 @@ public static function getDescribeContainerParametersTestData(): array
9191
}
9292

9393
#[DataProvider('getDescribeContainerBuilderTestData')]
94-
public function testDescribeContainerBuilder(ContainerBuilder $builder, $expectedDescription, array $options)
94+
public function testDescribeContainerBuilder(ContainerBuilder $builder, $expectedDescription, array $options, $file)
9595
{
9696
$this->assertDescription($expectedDescription, $builder, $options);
9797
}
@@ -102,7 +102,7 @@ public static function getDescribeContainerBuilderTestData(): array
102102
}
103103

104104
#[DataProvider('getDescribeContainerExistingClassDefinitionTestData')]
105-
public function testDescribeContainerExistingClassDefinition(Definition $definition, $expectedDescription)
105+
public function testDescribeContainerExistingClassDefinition(Definition $definition, $expectedDescription, $file)
106106
{
107107
$this->assertDescription($expectedDescription, $definition);
108108
}
@@ -113,7 +113,7 @@ public static function getDescribeContainerExistingClassDefinitionTestData(): ar
113113
}
114114

115115
#[DataProvider('getDescribeContainerDefinitionTestData')]
116-
public function testDescribeContainerDefinition(Definition $definition, $expectedDescription)
116+
public function testDescribeContainerDefinition(Definition $definition, $expectedDescription, $file)
117117
{
118118
$this->assertDescription($expectedDescription, $definition);
119119
}
@@ -124,7 +124,7 @@ public static function getDescribeContainerDefinitionTestData(): array
124124
}
125125

126126
#[DataProvider('getDescribeContainerDefinitionWithArgumentsShownTestData')]
127-
public function testDescribeContainerDefinitionWithArgumentsShown(Definition $definition, $expectedDescription)
127+
public function testDescribeContainerDefinitionWithArgumentsShown(Definition $definition, $expectedDescription, $file)
128128
{
129129
$this->assertDescription($expectedDescription, $definition, []);
130130
}
@@ -144,7 +144,7 @@ public static function getDescribeContainerDefinitionWithArgumentsShownTestData(
144144
}
145145

146146
#[DataProvider('getDescribeContainerAliasTestData')]
147-
public function testDescribeContainerAlias(Alias $alias, $expectedDescription)
147+
public function testDescribeContainerAlias(Alias $alias, $expectedDescription, $file)
148148
{
149149
$this->assertDescription($expectedDescription, $alias);
150150
}
@@ -155,7 +155,7 @@ public static function getDescribeContainerAliasTestData(): array
155155
}
156156

157157
#[DataProvider('getDescribeContainerDefinitionWhichIsAnAliasTestData')]
158-
public function testDescribeContainerDefinitionWhichIsAnAlias(Alias $alias, $expectedDescription, ContainerBuilder $builder, $options = [])
158+
public function testDescribeContainerDefinitionWhichIsAnAlias(Alias $alias, $expectedDescription, ContainerBuilder $builder, $options = [], $file = null)
159159
{
160160
$this->assertDescription($expectedDescription, $builder, $options);
161161
}
@@ -191,7 +191,7 @@ public static function getDescribeContainerDefinitionWhichIsAnAliasTestData(): a
191191
#[IgnoreDeprecations]
192192
#[Group('legacy')]
193193
#[DataProvider('getDescribeContainerParameterTestData')]
194-
public function testDescribeContainerParameter($parameter, $expectedDescription, array $options)
194+
public function testDescribeContainerParameter($parameter, $expectedDescription, array $options, $file)
195195
{
196196
$this->assertDescription($expectedDescription, $parameter, $options);
197197
}
@@ -214,7 +214,7 @@ public static function getDescribeContainerParameterTestData(): array
214214
}
215215

216216
#[DataProvider('getDescribeEventDispatcherTestData')]
217-
public function testDescribeEventDispatcher(EventDispatcher $eventDispatcher, $expectedDescription, array $options)
217+
public function testDescribeEventDispatcher(EventDispatcher $eventDispatcher, $expectedDescription, array $options, $file)
218218
{
219219
$this->assertDescription($expectedDescription, $eventDispatcher, $options);
220220
}
@@ -225,7 +225,7 @@ public static function getDescribeEventDispatcherTestData(): array
225225
}
226226

227227
#[DataProvider('getDescribeCallableTestData')]
228-
public function testDescribeCallable($callable, $expectedDescription)
228+
public function testDescribeCallable($callable, $expectedDescription, $file)
229229
{
230230
$this->assertDescription($expectedDescription, $callable);
231231
}
@@ -238,7 +238,7 @@ public static function getDescribeCallableTestData(): array
238238
#[IgnoreDeprecations]
239239
#[Group('legacy')]
240240
#[DataProvider('getDescribeDeprecatedCallableTestData')]
241-
public function testDescribeDeprecatedCallable($callable, $expectedDescription)
241+
public function testDescribeDeprecatedCallable($callable, $expectedDescription, $file)
242242
{
243243
$this->assertDescription($expectedDescription, $callable);
244244
}
@@ -265,7 +265,7 @@ public static function getClassDescriptionTestData(): array
265265
}
266266

267267
#[DataProvider('getDeprecationsTestData')]
268-
public function testGetDeprecations(ContainerBuilder $builder, $expectedDescription)
268+
public function testGetDeprecations(ContainerBuilder $builder, $expectedDescription, $file)
269269
{
270270
$this->assertDescription($expectedDescription, $builder, ['deprecations' => true]);
271271
}

src/Symfony/Bundle/FrameworkBundle/Tests/Console/Descriptor/TextDescriptorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ public static function getDescribeRouteWithControllerLinkTestData()
4747
}
4848

4949
#[DataProvider('getDescribeRouteWithControllerLinkTestData')]
50-
public function testDescribeRouteWithControllerLink(Route $route, $expectedDescription)
50+
public function testDescribeRouteWithControllerLink(Route $route, $expectedDescription, $file)
5151
{
5252
static::$fileLinkFormatter = new FileLinkFormatter('myeditor://open?file=%f&line=%l');
53-
parent::testDescribeRoute($route, str_replace('[:file:]', __FILE__, $expectedDescription));
53+
parent::testDescribeRoute($route, str_replace('[:file:]', __FILE__, $expectedDescription), $file);
5454
}
5555
}
5656

src/Symfony/Bundle/SecurityBundle/Tests/Functional/AuthenticatorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testFirewallUserProvider($email, $withinFirewall)
3232
}
3333

3434
#[DataProvider('provideEmails')]
35-
public function testWithoutUserProvider($email)
35+
public function testWithoutUserProvider($email, $withinFirewall)
3636
{
3737
$client = $this->createClient(['test_case' => 'Authenticator', 'root_config' => 'no_user_provider.yml']);
3838

src/Symfony/Component/Config/Tests/Definition/ArrayNodeTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public function testSetDeprecated()
270270
}
271271

272272
#[DataProvider('getDataWithIncludedExtraKeys')]
273-
public function testMergeWithoutIgnoringExtraKeys(array $prenormalizeds)
273+
public function testMergeWithoutIgnoringExtraKeys(array $prenormalizeds, array $merged)
274274
{
275275
$node = new ArrayNode('root');
276276
$node->addChild(new ScalarNode('foo'));
@@ -286,7 +286,7 @@ public function testMergeWithoutIgnoringExtraKeys(array $prenormalizeds)
286286
}
287287

288288
#[DataProvider('getDataWithIncludedExtraKeys')]
289-
public function testMergeWithIgnoringAndRemovingExtraKeys(array $prenormalizeds)
289+
public function testMergeWithIgnoringAndRemovingExtraKeys(array $prenormalizeds, array $merged)
290290
{
291291
$node = new ArrayNode('root');
292292
$node->addChild(new ScalarNode('foo'));

src/Symfony/Component/Console/Tests/Helper/TableTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,6 @@ public static function renderSetTitle()
12941294

12951295
TABLE
12961296
,
1297-
true,
12981297
],
12991298
'header contains multiple lines' => [
13001299
'Multiline'."\n".'header'."\n".'here',

src/Symfony/Component/ErrorHandler/Tests/Exception/FlattenExceptionTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public function testHeadersForHttpException()
117117
}
118118

119119
#[DataProvider('flattenDataProvider')]
120-
public function testFlattenHttpException(\Throwable $exception)
120+
public function testFlattenHttpException(\Throwable $exception, string $expectedClass)
121121
{
122122
$flattened = FlattenException::createFromThrowable($exception);
123123
$flattened2 = FlattenException::createFromThrowable($exception);
@@ -140,7 +140,7 @@ public function testThrowable()
140140
}
141141

142142
#[DataProvider('flattenDataProvider')]
143-
public function testPrevious(\Throwable $exception)
143+
public function testPrevious(\Throwable $exception, string $expectedClass)
144144
{
145145
$flattened = FlattenException::createFromThrowable($exception);
146146
$flattened2 = FlattenException::createFromThrowable($exception);
@@ -164,14 +164,14 @@ public function testPreviousError()
164164
}
165165

166166
#[DataProvider('flattenDataProvider')]
167-
public function testLine(\Throwable $exception)
167+
public function testLine(\Throwable $exception, string $expectedClass)
168168
{
169169
$flattened = FlattenException::createFromThrowable($exception);
170170
$this->assertSame($exception->getLine(), $flattened->getLine());
171171
}
172172

173173
#[DataProvider('flattenDataProvider')]
174-
public function testFile(\Throwable $exception)
174+
public function testFile(\Throwable $exception, string $expectedClass)
175175
{
176176
$flattened = FlattenException::createFromThrowable($exception);
177177
$this->assertSame($exception->getFile(), $flattened->getFile());

src/Symfony/Component/ExpressionLanguage/Tests/ExpressionLanguageTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ public function testNullSafeEvaluateFails($expression, $foo, $message)
370370
}
371371

372372
#[DataProvider('provideInvalidNullSafe')]
373-
public function testNullSafeCompileFails($expression, $foo)
373+
public function testNullSafeCompileFails($expression, $foo, $message)
374374
{
375375
$expressionLanguage = new ExpressionLanguage();
376376

0 commit comments

Comments
 (0)