Commit 45719077 authored by Oliver Klee's avatar Oliver Klee Committed by Christian Kuhn
Browse files

[TASK] Align the test field annotations with the testing framework

Also drop type annotations that already are present in the
corresponding field in the superclass, and drop some type annotations
that are redundant with the existing native type declarations.

This helps resolves a bunch of new PHPStan warnings after the recent
changes in the testing framework. It also helps static code analysis,
and makes the code more succinct.

Resolves: #97687
Releases: main, 11.5
Change-Id: I6f1b67f410f7e195b036bc5b5b528cb271a990b9
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74738


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Oliver Bartsch's avatarOliver Bartsch <bo@cedev.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent 79809796
......@@ -250,11 +250,6 @@ parameters:
count: 1
path: ../../typo3/sysext/backend/Classes/ViewHelpers/Uri/NewRecordViewHelper.php
-
message: "#^PHPDoc type array\\<string\\> of property TYPO3\\\\CMS\\\\Backend\\\\Tests\\\\Functional\\\\Configuration\\\\SiteConfiguration\\\\SiteConfigurationOverridesTest\\:\\:\\$testExtensionsToLoad is not covariant with PHPDoc type array\\<non\\-empty\\-string\\> of overridden property TYPO3\\\\TestingFramework\\\\Core\\\\Functional\\\\FunctionalTestCase\\:\\:\\$testExtensionsToLoad\\.$#"
count: 1
path: ../../typo3/sysext/backend/Tests/Functional/Configuration/SiteConfiguration/SiteConfigurationOverridesTest.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
......@@ -1660,26 +1655,11 @@ parameters:
count: 1
path: ../../typo3/sysext/core/Tests/Functional/Cache/Backend/RedisBackendTest.php
-
message: "#^PHPDoc type array of property TYPO3\\\\CMS\\\\Core\\\\Tests\\\\Functional\\\\Cache\\\\Backend\\\\Typo3DatabaseBackendTest\\:\\:\\$configurationToUseInTestInstance is not covariant with PHPDoc type array\\<string, mixed\\> of overridden property TYPO3\\\\TestingFramework\\\\Core\\\\Functional\\\\FunctionalTestCase\\:\\:\\$configurationToUseInTestInstance\\.$#"
count: 1
path: ../../typo3/sysext/core/Tests/Functional/Cache/Backend/Typo3DatabaseBackendTest.php
-
message: "#^PHPDoc type array of property TYPO3\\\\CMS\\\\Core\\\\Tests\\\\Functional\\\\Cache\\\\Frontend\\\\VariableFrontendTest\\:\\:\\$configurationToUseInTestInstance is not covariant with PHPDoc type array\\<string, mixed\\> of overridden property TYPO3\\\\TestingFramework\\\\Core\\\\Functional\\\\FunctionalTestCase\\:\\:\\$configurationToUseInTestInstance\\.$#"
count: 1
path: ../../typo3/sysext/core/Tests/Functional/Cache/Frontend/VariableFrontendTest.php
-
message: "#^Call to an undefined method TYPO3\\\\CMS\\\\Core\\\\Collection\\\\CollectionInterface\\:\\:add\\(\\)\\.$#"
count: 1
path: ../../typo3/sysext/core/Tests/Functional/Category/Collection/CategoryCollectionTest.php
-
message: "#^PHPDoc type array of property TYPO3\\\\CMS\\\\Core\\\\Tests\\\\Functional\\\\Command\\\\CacheFlushCommandTest\\:\\:\\$configurationToUseInTestInstance is not covariant with PHPDoc type array\\<string, mixed\\> of overridden property TYPO3\\\\TestingFramework\\\\Core\\\\Functional\\\\FunctionalTestCase\\:\\:\\$configurationToUseInTestInstance\\.$#"
count: 1
path: ../../typo3/sysext/core/Tests/Functional/Command/CacheFlushCommandTest.php
-
message: "#^PHPDoc type string of property TYPO3\\\\CMS\\\\Core\\\\Tests\\\\Functional\\\\DataHandling\\\\Regular\\\\Hooks\\\\PagesTsConfigGuardTest\\:\\:\\$backendUserFixture is not covariant with PHPDoc type non\\-empty\\-string of overridden property TYPO3\\\\TestingFramework\\\\Core\\\\Functional\\\\FunctionalTestCase\\:\\:\\$backendUserFixture\\.$#"
count: 1
......@@ -1700,11 +1680,6 @@ parameters:
count: 1
path: ../../typo3/sysext/core/Tests/Functional/Fixtures/Frontend/PhpError.php
-
message: "#^PHPDoc type array\\<string\\> of property TYPO3\\\\CMS\\\\Core\\\\Tests\\\\Functional\\\\Mail\\\\FluidEmailTest\\:\\:\\$testExtensionsToLoad is not covariant with PHPDoc type array\\<non\\-empty\\-string\\> of overridden property TYPO3\\\\TestingFramework\\\\Core\\\\Functional\\\\FunctionalTestCase\\:\\:\\$testExtensionsToLoad\\.$#"
count: 1
path: ../../typo3/sysext/core/Tests/Functional/Mail/FluidEmailTest.php
-
message: "#^Parameter \\#3 \\$compress of method TYPO3\\\\CMS\\\\Core\\\\Page\\\\PageRenderer\\:\\:addCssInlineBlock\\(\\) expects bool, null given\\.$#"
count: 1
......@@ -2606,7 +2581,7 @@ parameters:
path: ../../typo3/sysext/extbase/Tests/Functional/Property/TypeConverter/ObjectConverterTest.php
-
message: "#^Property class@anonymous/extbase/Tests/Functional/Property/TypeConverter/ObjectConverterTest\\.php\\:343\\:\\:\\$name is unused\\.$#"
message: "#^Property class@anonymous/extbase/Tests/Functional/Property/TypeConverter/ObjectConverterTest\\.php\\:340\\:\\:\\$name is unused\\.$#"
count: 1
path: ../../typo3/sysext/extbase/Tests/Functional/Property/TypeConverter/ObjectConverterTest.php
......@@ -3875,11 +3850,6 @@ parameters:
count: 1
path: ../../typo3/sysext/frontend/Tests/Functional/Imaging/GifBuilderTest.php
-
message: "#^PHPDoc type array\\<string\\> of property TYPO3\\\\CMS\\\\Frontend\\\\Tests\\\\Functional\\\\SiteHandling\\\\EidRequestTest\\:\\:\\$testExtensionsToLoad is not covariant with PHPDoc type array\\<non\\-empty\\-string\\> of overridden property TYPO3\\\\TestingFramework\\\\Core\\\\Functional\\\\FunctionalTestCase\\:\\:\\$testExtensionsToLoad\\.$#"
count: 1
path: ../../typo3/sysext/frontend/Tests/Functional/SiteHandling/EidRequestTest.php
-
message: "#^Else branch is unreachable because previous condition is always true\\.$#"
count: 1
......@@ -4125,16 +4095,6 @@ parameters:
count: 1
path: ../../typo3/sysext/impexp/Tests/Functional/Export/ExportPageTreeViewTest.php
-
message: "#^PHPDoc type array of property TYPO3\\\\CMS\\\\Impexp\\\\Tests\\\\Functional\\\\Import\\\\PagesAndTtContentWithImagesInFilledDatabaseTest\\:\\:\\$additionalFoldersToCreate is not covariant with PHPDoc type array\\<non\\-empty\\-string\\> of overridden property TYPO3\\\\TestingFramework\\\\Core\\\\Functional\\\\FunctionalTestCase\\:\\:\\$additionalFoldersToCreate\\.$#"
count: 1
path: ../../typo3/sysext/impexp/Tests/Functional/Import/PagesAndTtContentWithImagesInFilledDatabaseTest.php
-
message: "#^PHPDoc type array of property TYPO3\\\\CMS\\\\Impexp\\\\Tests\\\\Functional\\\\Import\\\\PagesAndTtContentWithRteImagesAndFileLinkTest\\:\\:\\$additionalFoldersToCreate is not covariant with PHPDoc type array\\<non\\-empty\\-string\\> of overridden property TYPO3\\\\TestingFramework\\\\Core\\\\Functional\\\\FunctionalTestCase\\:\\:\\$additionalFoldersToCreate\\.$#"
count: 1
path: ../../typo3/sysext/impexp/Tests/Functional/Import/PagesAndTtContentWithRteImagesAndFileLinkTest.php
-
message: "#^Parameter \\#2 \\$all of method TYPO3\\\\CMS\\\\Impexp\\\\Import\\:\\:loadFile\\(\\) expects bool, int given\\.$#"
count: 1
......@@ -4550,11 +4510,6 @@ parameters:
count: 1
path: ../../typo3/sysext/scheduler/Classes/Scheduler.php
-
message: "#^PHPDoc type array of property TYPO3\\\\CMS\\\\Seo\\\\Tests\\\\Functional\\\\XmlSitemap\\\\XmlSitemapPagesWithHideIfNotTranslatedTest\\:\\:\\$configurationToUseInTestInstance is not covariant with PHPDoc type array\\<string, mixed\\> of overridden property TYPO3\\\\CMS\\\\Frontend\\\\Tests\\\\Functional\\\\SiteHandling\\\\AbstractTestCase\\:\\:\\$configurationToUseInTestInstance\\.$#"
count: 1
path: ../../typo3/sysext/seo/Tests/Functional/XmlSitemap/XmlSitemapPagesWithHideIfNotTranslatedTest.php
-
message: "#^If condition is always true\\.$#"
count: 1
......
......@@ -36,9 +36,6 @@ class AdminPanelInitiatorTest extends UnitTestCase
{
use ProphecyTrait;
/**
* @var bool Reset singletons created by subject
*/
protected bool $resetSingletonInstances = true;
/**
......
......@@ -22,17 +22,11 @@ use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
class SiteConfigurationOverridesTest extends FunctionalTestCase
{
/**
* @var bool Speed up this test case, it needs no database
*/
protected bool $initializeDatabase = false;
/** @var array */
protected array $subject;
/**
* @var string[]
*/
protected array $testExtensionsToLoad = [
'typo3/sysext/backend/Tests/Functional/Configuration/SiteConfiguration/Fixtures/Extensions/conf_overriding/a',
'typo3/sysext/backend/Tests/Functional/Configuration/SiteConfiguration/Fixtures/Extensions/conf_overriding/b',
......
......@@ -28,9 +28,6 @@ use TYPO3\TestingFramework\Core\Functional\FunctionalTestCase;
class RouterTest extends FunctionalTestCase
{
/**
* @var bool Speed up this test case, it needs no database
*/
protected bool $initializeDatabase = false;
/**
......
......@@ -26,9 +26,6 @@ use TYPO3Fluid\Fluid\View\TemplateView;
class EditRecordViewHelperTest extends FunctionalTestCase
{
/**
* @var bool Speed up this test case, it needs no database
*/
protected bool $initializeDatabase = false;
protected ServerRequest $request;
......
......@@ -26,9 +26,6 @@ use TYPO3Fluid\Fluid\View\TemplateView;
class NewRecordViewHelperTest extends FunctionalTestCase
{
/**
* @var bool Speed up this test case, it needs no database
*/
protected bool $initializeDatabase = false;
protected ServerRequest $request;
......
......@@ -25,9 +25,6 @@ use TYPO3Fluid\Fluid\View\TemplateView;
class IfHasStateViewHelperTest extends FunctionalTestCase
{
/**
* @var bool Speed up this test case, it needs no database
*/
protected bool $initializeDatabase = false;
protected TemplateView $view;
......
......@@ -26,9 +26,6 @@ use TYPO3Fluid\Fluid\View\TemplateView;
class EditRecordViewHelperTest extends FunctionalTestCase
{
/**
* @var bool Speed up this test case, it needs no database
*/
protected bool $initializeDatabase = false;
protected ServerRequest $request;
......
......@@ -26,9 +26,6 @@ use TYPO3Fluid\Fluid\View\TemplateView;
class NewRecordViewHelperTest extends FunctionalTestCase
{
/**
* @var bool Speed up this test case, it needs no database
*/
protected bool $initializeDatabase = false;
protected ServerRequest $request;
......
......@@ -28,9 +28,6 @@ class EditDocumentControllerTest extends UnitTestCase
{
use ProphecyTrait;
/**
* @var bool
*/
protected bool $resetSingletonInstances = true;
/**
......
......@@ -36,9 +36,6 @@ class LoginControllerTest extends UnitTestCase
{
use ProphecyTrait;
/**
* @var bool Reset singletons created by subject
*/
protected bool $resetSingletonInstances = true;
/**
......
......@@ -28,9 +28,6 @@ class TcaFolderTest extends UnitTestCase
{
use ProphecyTrait;
/**
* @var bool Reset singletons created by subject
*/
protected bool $resetSingletonInstances = true;
/**
......
......@@ -29,9 +29,6 @@ class TcaGroupTest extends UnitTestCase
{
use ProphecyTrait;
/**
* @var bool Reset singletons created by subject
*/
protected bool $resetSingletonInstances = true;
/**
......
......@@ -47,9 +47,6 @@ class TcaSelectTreeItemsTest extends UnitTestCase
{
use ProphecyTrait;
/**
* @var bool Reset singletons created by subject
*/
protected bool $resetSingletonInstances = true;
/**
......
......@@ -31,9 +31,6 @@ class InlineStackProcessorTest extends UnitTestCase
{
use ProphecyTrait;
/**
* @var bool Reset singletons created by subject
*/
protected bool $resetSingletonInstances = true;
public function setUp(): void
......
......@@ -41,9 +41,6 @@ class BackendUtilityTest extends UnitTestCase
{
use ProphecyTrait;
/**
* @var bool
*/
protected bool $resetSingletonInstances = true;
///////////////////////////////////////
......
......@@ -27,10 +27,6 @@ use TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\PageTree;
*/
class ExportCest extends AbstractCest
{
/**
* Absolute path to files that must be removed
* after a test - handled in _after
*/
protected array $testFilesToDelete = [];
protected string $inPageTree = '#typo3-pagetree-treeContainer .nodes';
......
......@@ -27,7 +27,6 @@ use TYPO3\CMS\Core\Tests\Acceptance\Support\Helper\PageTree;
*/
class ImportCest extends AbstractCest
{
/** Absolute path to files that must be removed */
protected array $testFilesToDelete = [];
protected string $inPageTree = '#typo3-pagetree-treeContainer .nodes';
......
......@@ -28,9 +28,6 @@ class MemcachedBackendTest extends FunctionalTestCase
{
use ProphecyTrait;
/**
* @var bool Speed up this test case, it needs no database
*/
protected bool $initializeDatabase = false;
/**
......
......@@ -38,9 +38,6 @@ class RedisBackendTest extends FunctionalTestCase
{
use ProphecyTrait;
/**
* @var bool Speed up this test case, it needs no database
*/
protected bool $initializeDatabase = false;
/**
......
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