Skip to content

Commit

Permalink
[TASK] Update invalid test data providers
Browse files Browse the repository at this point in the history
Backport of https://review.typo3.org/c/Packages/TYPO3.CMS/+/83155
to TYPO3 v12.

PHPUnit 10.5.18 introduces deprecation warning due to
use of non-matching parameter names with data providers,
introduced by sebastianbergmann/phpunit#5812.

This patch backports changes that were made for PHPUnit v11 support,
which also addresses these kind of deprecation warnings too.

Resolves: #103634
Related: #103222
Releases: 12.4
Change-Id: Ia9a1f7c5d62894dc80b3d1f9b465fb488b3250fc
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/83788
Tested-by: Anja Leichsenring <[email protected]>
Reviewed-by: Anja Leichsenring <[email protected]>
Reviewed-by: Christian Kuhn <[email protected]>
Tested-by: core-ci <[email protected]>
Tested-by: Stefan Bürk <[email protected]>
Reviewed-by: Stefan Bürk <[email protected]>
Tested-by: Christian Kuhn <[email protected]>
  • Loading branch information
lolli42 authored and sbuerk committed Apr 15, 2024
1 parent 9679d3a commit bdd7658
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions Tests/Functional/UpgradeAnalysis/DocumentationFileTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ public function tearDown(): void
public static function invalidDirProvider(): array
{
return [
['root' => '/'],
['etc' => '/etc'],
['etc/passwd' => '/etc/passwd'],
'root' => ['/'],
'etc' => ['/etc'],
'etc/passwd' => ['/etc/passwd'],
];
}

Expand All @@ -109,8 +109,8 @@ public function findDocumentationFilesThrowsExceptionIfPathIsNotInGivenChangelog
public static function invalidFilesProvider(): array
{
return [
['/etc/passwd' => '/etc/passwd'],
['root' => '/'],
'/etc/passwd' => ['/etc/passwd'],
'root' => ['/'],
];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static function errorCodesDataProvider(): array

#[DataProvider('errorCodesDataProvider')]
#[Test]
public function renderPhpCodesCorrectly(int $errorCode, string $expected): void
public function renderPhpCodesCorrectly(int $errorCode, string $expectedString): void
{
// Happy little hack for VH tests in install tool: ViewHelperResolver
// createViewHelperInstanceFromClassName() has an early check for
Expand All @@ -66,6 +66,6 @@ public function renderPhpCodesCorrectly(int $errorCode, string $expected): void
$context = $this->get(RenderingContextFactory::class)->create();
$context->getViewHelperResolver()->addNamespace('install', 'TYPO3\\CMS\\Install\\ViewHelpers');
$context->getTemplatePaths()->setTemplateSource('<install:format.phpErrorCode phpErrorCode="' . $errorCode . '" />');
self::assertSame($expected, (new TemplateView($context))->render());
self::assertSame($expectedString, (new TemplateView($context))->render());
}
}

0 comments on commit bdd7658

Please sign in to comment.