Commit e24d05f4 authored by Oliver Klee's avatar Oliver Klee Committed by Stefan Bürk
Browse files

[TASK] Improve and clean up some type annotations in tests

This gets rids of some PHPStan warnings triggered by the latest
testing framework raise.

Used command:
> ./Build/Scripts/runTests.sh -s phpstanGenerateBaseline

Resolves: #97702
Releases: main
Change-Id: I95059f39465df0ad868645c0c66dac19327f8882
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74778


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Simon Schaufelberger's avatarSimon Schaufelberger <simonschaufi+typo3@gmail.com>
Tested-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
Reviewed-by: Simon Schaufelberger's avatarSimon Schaufelberger <simonschaufi+typo3@gmail.com>
Reviewed-by: Stefan Bürk's avatarStefan Bürk <stefan@buerk.tech>
parent 01a24ae0
Pipeline #27572 passed with stages
in 18 minutes and 5 seconds
......@@ -245,11 +245,6 @@ parameters:
count: 1
path: ../../typo3/sysext/backend/Classes/ViewHelpers/Uri/NewRecordViewHelper.php
-
message: "#^PHPDoc type string of property TYPO3\\\\CMS\\\\Backend\\\\Tests\\\\Functional\\\\Controller\\\\Page\\\\TreeControllerTest\\:\\:\\$backendUserFixture is not covariant with PHPDoc type non\\-empty\\-string of overridden property TYPO3\\\\TestingFramework\\\\Core\\\\Functional\\\\FunctionalTestCase\\:\\:\\$backendUserFixture\\.$#"
count: 1
path: ../../typo3/sysext/backend/Tests/Functional/Controller/Page/TreeControllerTest.php
-
message: "#^Constructor of class TYPO3\\\\CMS\\\\Backend\\\\Tests\\\\Unit\\\\Form\\\\Fixtures\\\\NodeFactory\\\\NodeElements\\\\BarElement has an unused parameter \\$data\\.$#"
count: 1
......@@ -2067,7 +2062,7 @@ parameters:
-
message: "#^Property TYPO3\\\\TestingFramework\\\\Core\\\\Unit\\\\UnitTestCase\\:\\:\\$testFilesToDelete \\(array\\<non\\-empty\\-string\\>\\) does not accept non\\-empty\\-array\\<string\\>\\.$#"
count: 4
count: 3
path: ../../typo3/sysext/core/Tests/Unit/Utility/GeneralUtilityTest.php
-
......@@ -4290,11 +4285,6 @@ parameters:
count: 1
path: ../../typo3/sysext/linkvalidator/Tests/Functional/Repository/BrokenLinkRepositoryTest.php
-
message: "#^Property TYPO3\\\\TestingFramework\\\\Core\\\\Functional\\\\FunctionalTestCase\\:\\:\\$backendUserFixture \\(non\\-empty\\-string\\) does not accept string\\.$#"
count: 1
path: ../../typo3/sysext/linkvalidator/Tests/Functional/Repository/BrokenLinkRepositoryTest.php
-
message: "#^Parameter \\#2 \\$softRefEntry of method TYPO3\\\\CMS\\\\Linkvalidator\\\\Linktype\\\\ExternalLinktype\\:\\:checkLink\\(\\) expects array, null given\\.$#"
count: 2
......@@ -4355,11 +4345,6 @@ parameters:
count: 1
path: ../../typo3/sysext/recordlist/Classes/RecordList/DatabaseRecordList.php
-
message: "#^PHPDoc type string of property TYPO3\\\\CMS\\\\Recycler\\\\Tests\\\\Functional\\\\Recycle\\\\AbstractRecycleTestCase\\:\\:\\$backendUserFixture is not covariant with PHPDoc type non\\-empty\\-string of overridden property TYPO3\\\\TestingFramework\\\\Core\\\\Functional\\\\FunctionalTestCase\\:\\:\\$backendUserFixture\\.$#"
count: 1
path: ../../typo3/sysext/recycler/Tests/Functional/Recycle/AbstractRecycleTestCase.php
-
message: "#^Call to an undefined method TYPO3\\\\CMS\\\\Recycler\\\\Task\\\\CleanerFieldProvider\\:\\:expects\\(\\)\\.$#"
count: 1
......
......@@ -55,11 +55,6 @@ class TreeControllerTest extends FunctionalTestCase
*/
private $context;
/**
* The fixture which is used when initializing a backend user
*
* @var string
*/
protected string $backendUserFixture = 'EXT:core/Tests/Functional/Fixtures/be_users.xml';
protected function setUp(): void
......
......@@ -2401,9 +2401,6 @@ class GeneralUtilityTest extends UnitTestCase
self::assertSame($result, $expectedResult);
}
/**
* @return array
*/
public function validFilePathForTypo3tempDirDataProvider(): array
{
return [
......@@ -2428,7 +2425,7 @@ class GeneralUtilityTest extends UnitTestCase
/**
* @test
* @dataProvider validFilePathForTypo3tempDirDataProvider
* @param string $filePath
* @param non-empty-string $filePath
*/
public function writeFileToTypo3tempDirWorksWithValidPath(string $filePath): void
{
......
......@@ -794,6 +794,9 @@ class BrokenLinkRepositoryTest extends FunctionalTestCase
self::assertEquals($expectedResult, $results);
}
/**
* @param non-empty-string $fixtureFile
*/
protected function setupBackendUserAndGroup(int $uid, string $fixtureFile, string $groupFixtureFile): void
{
if ($groupFixtureFile) {
......
......@@ -28,11 +28,6 @@ abstract class AbstractRecycleTestCase extends FunctionalTestCase
{
protected array $coreExtensionsToLoad = ['recycler'];
/**
* The fixture which is used when initializing a backend user
*
* @var string
*/
protected string $backendUserFixture = 'typo3/sysext/recycler/Tests/Functional/Fixtures/Database/be_users.xml';
/**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment