From 5ff536b21dab2807a848acc52925b837bd3fa2aa Mon Sep 17 00:00:00 2001 From: Lee Rowlands <lee.rowlands@previousnext.com.au> Date: Fri, 3 Jan 2025 14:26:43 +1000 Subject: [PATCH] Issue #3477669 by quietone: Fix VariableComment.Missing in tests but not core/tests --- core/.phpstan-baseline.php | 6 ------ .../block/tests/src/Functional/BlockUiTest.php | 2 ++ .../block/tests/src/Kernel/ConfigActionsTest.php | 3 +++ .../tests/src/Functional/CommentEntityTest.php | 7 +++++++ .../tests/src/Kernel/ConfigActionsTest.php | 5 +++++ .../field/tests/src/Kernel/ConfigActionsTest.php | 3 +++ .../Plugin/migrate/process/d6/FileUriTest.php | 3 +++ .../image/tests/src/Kernel/ConfigActionsTest.php | 3 +++ .../src/TraversableObject.php | 3 +++ .../tests/src/Kernel/ConfigActionsTest.php | 3 +++ .../src/Unit/LanguageNegotiationUrlTest.php | 11 +++++++++++ .../src/Functional/LocaleUpdateCronTest.php | 1 + .../media/tests/src/Kernel/ConfigActionsTest.php | 3 +++ .../OEmbedResourceConstraintValidatorTest.php | 5 ++++- .../destination/EntityContentBaseTest.php | 3 +++ .../migrate/destination/EntityRevisionTest.php | 3 +++ .../PerComponentEntityDisplayTest.php | 8 ++++++++ .../PerComponentEntityFormDisplayTest.php | 8 ++++++++ .../mysql/tests/src/Unit/InstallTasksTest.php | 3 +++ .../node/tests/src/Kernel/ConfigActionsTest.php | 3 +++ .../src/FixtureManipulator.php | 11 +++++++++-- .../tests/src/Unit/StageBaseTest.php | 5 ++++- .../Validation/Constraint/RestTestConstraint.php | 3 +++ .../Constraint/EntityTestCompositeConstraint.php | 3 +++ .../Constraint/EntityTestEntityLevel.php | 5 +++++ .../Constraint/FieldWidgetConstraint.php | 3 +++ .../src/Twig/NodeVisitor/TestNodeVisitor.php | 6 ++++++ .../tests/src/Functional/Cache/CacheTestBase.php | 11 +++++++++++ .../FileTransfer/MockTestConnection.php | 7 +++++++ .../system/tests/src/Functional/Form/UrlTest.php | 2 -- .../src/Functional/Module/ModuleTestBase.php | 3 +++ .../tests/src/Functional/Pager/PagerTest.php | 2 -- .../src/Functional/System/AccessDeniedTest.php | 3 +++ .../System/MainContentFallbackTest.php | 7 +++++++ .../src/Functional/System/PageNotFoundTest.php | 3 +++ .../src/Functional/System/PageTitleTest.php | 4 ++++ .../Functional/System/SiteMaintenanceTest.php | 3 +++ .../d6/MigrateSystemConfigurationTest.php | 3 +++ .../d7/MigrateSystemConfigurationTest.php | 3 +++ .../PathBasedBreadcrumbBuilderTest.php | 3 +++ .../Kernel/Views/HandlerFilterPermissionTest.php | 1 + .../src/Plugin/views/query/QueryTest.php | 16 ++++++++++++++++ .../BlockExposedFilterAJAXTest.php | 3 +++ .../ClickSortingAJAXTest.php | 3 +++ .../FunctionalJavascript/PaginationAJAXTest.php | 3 +++ .../Plugin/Derivative/ViewsLocalTaskTest.php | 6 ++++++ .../src/FunctionalJavascript/DisplayTest.php | 3 +++ .../src/Functional/WorkspaceTestUtilities.php | 3 +++ core/phpcs.xml.dist | 1 + .../minimal/tests/src/Functional/MinimalTest.php | 3 +++ .../tests/src/Functional/StandardTest.php | 3 +++ 51 files changed, 207 insertions(+), 14 deletions(-) diff --git a/core/.phpstan-baseline.php b/core/.phpstan-baseline.php index 5e76e8752801..9b06d711a992 100644 --- a/core/.phpstan-baseline.php +++ b/core/.phpstan-baseline.php @@ -26611,12 +26611,6 @@ 'count' => 1, 'path' => __DIR__ . '/modules/media/tests/src/Kernel/MediaThumbnailFormatterTest.php', ]; -$ignoreErrors[] = [ - 'message' => '#^Method class@anonymous/core/modules/media/tests/src/Kernel/OEmbedResourceConstraintValidatorTest\\.php\\:108\\:\\:getEntity\\(\\) has no return type specified\\.$#', - 'identifier' => 'missingType.return', - 'count' => 1, - 'path' => __DIR__ . '/modules/media/tests/src/Kernel/OEmbedResourceConstraintValidatorTest.php', -]; $ignoreErrors[] = [ 'message' => '#^Method Drupal\\\\Tests\\\\media\\\\Unit\\\\ResourceTest\\:\\:setDimensionsTestCases\\(\\) has no return type specified\\.$#', 'identifier' => 'missingType.return', diff --git a/core/modules/block/tests/src/Functional/BlockUiTest.php b/core/modules/block/tests/src/Functional/BlockUiTest.php index 76bc4f86f91c..647eadc165a5 100644 --- a/core/modules/block/tests/src/Functional/BlockUiTest.php +++ b/core/modules/block/tests/src/Functional/BlockUiTest.php @@ -34,6 +34,8 @@ class BlockUiTest extends BrowserTestBase { */ protected $defaultTheme = 'stark'; + protected $regions; + /** * The submitted block values used by this test. * diff --git a/core/modules/block/tests/src/Kernel/ConfigActionsTest.php b/core/modules/block/tests/src/Kernel/ConfigActionsTest.php index b12ee0edc940..fd7fa6f34c92 100644 --- a/core/modules/block/tests/src/Kernel/ConfigActionsTest.php +++ b/core/modules/block/tests/src/Kernel/ConfigActionsTest.php @@ -27,6 +27,9 @@ class ConfigActionsTest extends KernelTestBase { */ protected static $modules = ['block', 'system', 'user']; + /** + * The configuration action manager. + */ private readonly ConfigActionManager $configActionManager; /** diff --git a/core/modules/comment/tests/src/Functional/CommentEntityTest.php b/core/modules/comment/tests/src/Functional/CommentEntityTest.php index 7d07b90472c9..c680ebc42e67 100644 --- a/core/modules/comment/tests/src/Functional/CommentEntityTest.php +++ b/core/modules/comment/tests/src/Functional/CommentEntityTest.php @@ -38,7 +38,14 @@ class CommentEntityTest extends CommentTestBase { */ protected $defaultTheme = 'stark'; + /** + * A vocabulary used for testing. + */ protected $vocab; + + /** + * The comment type used for testing. + */ protected $commentType; /** diff --git a/core/modules/contact/tests/src/Kernel/ConfigActionsTest.php b/core/modules/contact/tests/src/Kernel/ConfigActionsTest.php index a9a2eaada66b..31210efca435 100644 --- a/core/modules/contact/tests/src/Kernel/ConfigActionsTest.php +++ b/core/modules/contact/tests/src/Kernel/ConfigActionsTest.php @@ -18,6 +18,11 @@ class ConfigActionsTest extends KernelTestBase { */ protected static $modules = ['contact', 'system', 'user']; + /** + * The configuration action manager. + * + * @var \Drupal\Core\Config\Action\ConfigActionManager + */ private readonly ConfigActionManager $configActionManager; /** diff --git a/core/modules/field/tests/src/Kernel/ConfigActionsTest.php b/core/modules/field/tests/src/Kernel/ConfigActionsTest.php index 62086177ea9c..15dc362a8be5 100644 --- a/core/modules/field/tests/src/Kernel/ConfigActionsTest.php +++ b/core/modules/field/tests/src/Kernel/ConfigActionsTest.php @@ -20,6 +20,9 @@ class ConfigActionsTest extends KernelTestBase { */ protected static $modules = ['entity_test', 'field', 'user']; + /** + * The configuration manager. + */ private readonly ConfigActionManager $configActionManager; /** diff --git a/core/modules/file/tests/src/Unit/Plugin/migrate/process/d6/FileUriTest.php b/core/modules/file/tests/src/Unit/Plugin/migrate/process/d6/FileUriTest.php index 157633388831..1118e0aae68e 100644 --- a/core/modules/file/tests/src/Unit/Plugin/migrate/process/d6/FileUriTest.php +++ b/core/modules/file/tests/src/Unit/Plugin/migrate/process/d6/FileUriTest.php @@ -15,6 +15,9 @@ */ class FileUriTest extends MigrateTestCase { + /** + * The plugin configuration. + */ protected $migrationConfiguration = [ 'id' => 'test', ]; diff --git a/core/modules/image/tests/src/Kernel/ConfigActionsTest.php b/core/modules/image/tests/src/Kernel/ConfigActionsTest.php index e8391499c471..1334d832f61a 100644 --- a/core/modules/image/tests/src/Kernel/ConfigActionsTest.php +++ b/core/modules/image/tests/src/Kernel/ConfigActionsTest.php @@ -18,6 +18,9 @@ class ConfigActionsTest extends KernelTestBase { */ protected static $modules = ['image', 'system']; + /** + * The configuration action manager. + */ private readonly ConfigActionManager $configActionManager; /** diff --git a/core/modules/jsonapi/tests/modules/jsonapi_test_data_type/src/TraversableObject.php b/core/modules/jsonapi/tests/modules/jsonapi_test_data_type/src/TraversableObject.php index 63058f1620fb..c5c10cb83047 100644 --- a/core/modules/jsonapi/tests/modules/jsonapi_test_data_type/src/TraversableObject.php +++ b/core/modules/jsonapi/tests/modules/jsonapi_test_data_type/src/TraversableObject.php @@ -9,6 +9,9 @@ */ class TraversableObject implements \IteratorAggregate { + /** + * The test data. + */ public $property = "value"; /** diff --git a/core/modules/language/tests/src/Kernel/ConfigActionsTest.php b/core/modules/language/tests/src/Kernel/ConfigActionsTest.php index 537678199bf1..0b159f746386 100644 --- a/core/modules/language/tests/src/Kernel/ConfigActionsTest.php +++ b/core/modules/language/tests/src/Kernel/ConfigActionsTest.php @@ -18,6 +18,9 @@ class ConfigActionsTest extends KernelTestBase { */ protected static $modules = ['language']; + /** + * The configuration action manager. + */ private readonly ConfigActionManager $configActionManager; /** diff --git a/core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php b/core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php index c08b0b970570..a79c9136248a 100644 --- a/core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php +++ b/core/modules/language/tests/src/Unit/LanguageNegotiationUrlTest.php @@ -18,8 +18,19 @@ */ class LanguageNegotiationUrlTest extends UnitTestCase { + /** + * The language manager. + */ protected $languageManager; + + /** + * The test user. + */ protected $user; + + /** + * An array of languages. + */ protected array $languages; /** diff --git a/core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php b/core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php index f0ab40d31cb0..7d0706157b45 100644 --- a/core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php +++ b/core/modules/locale/tests/src/Functional/LocaleUpdateCronTest.php @@ -16,6 +16,7 @@ class LocaleUpdateCronTest extends LocaleUpdateBase { use CronRunTrait; + protected $batchOutput = []; /** * {@inheritdoc} diff --git a/core/modules/media/tests/src/Kernel/ConfigActionsTest.php b/core/modules/media/tests/src/Kernel/ConfigActionsTest.php index 9ec9d21495ce..98e765c689a2 100644 --- a/core/modules/media/tests/src/Kernel/ConfigActionsTest.php +++ b/core/modules/media/tests/src/Kernel/ConfigActionsTest.php @@ -19,6 +19,9 @@ class ConfigActionsTest extends KernelTestBase { */ protected static $modules = ['media']; + /** + * The configuration action manager. + */ private readonly ConfigActionManager $configActionManager; /** diff --git a/core/modules/media/tests/src/Kernel/OEmbedResourceConstraintValidatorTest.php b/core/modules/media/tests/src/Kernel/OEmbedResourceConstraintValidatorTest.php index 58d27445a1d8..c3d9c9d3c2e8 100644 --- a/core/modules/media/tests/src/Kernel/OEmbedResourceConstraintValidatorTest.php +++ b/core/modules/media/tests/src/Kernel/OEmbedResourceConstraintValidatorTest.php @@ -107,13 +107,16 @@ public function testValidateUrlResolverInvoked(): void { protected function getValue(Media $media) { return new class ($media) { + /** + * The test entity. + */ private $entity; public function __construct($entity) { $this->entity = $entity; } - public function getEntity() { + public function getEntity(): Media { return $this->entity; } diff --git a/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php b/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php index bb1368a1344f..791e0fd8592a 100644 --- a/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php +++ b/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityContentBaseTest.php @@ -111,6 +111,9 @@ public function testUntranslatable(): void { */ class EntityTestDestination extends EntityContentBase { + /** + * The test entity. + */ private $entity = NULL; public function setEntity($entity): void { diff --git a/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityRevisionTest.php b/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityRevisionTest.php index ddb4871f2d28..b15951e376b7 100644 --- a/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityRevisionTest.php +++ b/core/modules/migrate/tests/src/Unit/Plugin/migrate/destination/EntityRevisionTest.php @@ -100,6 +100,9 @@ public function testUntranslatable(): void { */ class EntityRevisionTestDestination extends EntityRevision { + /** + * The test entity. + */ private $entity = NULL; public function setEntity($entity): void { diff --git a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php index db25c5c5d738..bcb16444814f 100644 --- a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php +++ b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityDisplayTest.php @@ -49,7 +49,15 @@ public function testImport(): void { class TestPerComponentEntityDisplay extends ComponentEntityDisplayBase { const MODE_NAME = 'view_mode'; + + /** + * The arguments of getEntity. + */ protected $testValues; + + /** + * The test entity. + */ protected $entity; public function __construct($entity) { diff --git a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php index 9ccf8ea8c582..2c76b29b9cf1 100644 --- a/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php +++ b/core/modules/migrate/tests/src/Unit/destination/PerComponentEntityFormDisplayTest.php @@ -49,7 +49,15 @@ public function testImport(): void { class TestPerComponentEntityFormDisplay extends PerComponentEntityFormDisplay { const MODE_NAME = 'form_mode'; + + /** + * The test values. + */ protected $testValues; + + /** + * The test entity. + */ protected $entity; public function __construct($entity) { diff --git a/core/modules/mysql/tests/src/Unit/InstallTasksTest.php b/core/modules/mysql/tests/src/Unit/InstallTasksTest.php index cd5447eee399..7fcdb5273087 100644 --- a/core/modules/mysql/tests/src/Unit/InstallTasksTest.php +++ b/core/modules/mysql/tests/src/Unit/InstallTasksTest.php @@ -43,6 +43,9 @@ private function createTasks(): Tasks { return new class($connection) extends Tasks { + /** + * The database connection. + */ private $connection; public function __construct(Connection $connection) { diff --git a/core/modules/node/tests/src/Kernel/ConfigActionsTest.php b/core/modules/node/tests/src/Kernel/ConfigActionsTest.php index 97fea6cf281c..9a682cbe0d74 100644 --- a/core/modules/node/tests/src/Kernel/ConfigActionsTest.php +++ b/core/modules/node/tests/src/Kernel/ConfigActionsTest.php @@ -21,6 +21,9 @@ class ConfigActionsTest extends KernelTestBase { */ protected static $modules = ['field', 'node', 'system', 'text', 'user']; + /** + * The configuration action manager. + */ private readonly ConfigActionManager $configActionManager; /** diff --git a/core/modules/package_manager/tests/modules/fixture_manipulator/src/FixtureManipulator.php b/core/modules/package_manager/tests/modules/fixture_manipulator/src/FixtureManipulator.php index eac4ed0c50a8..7d5dc8a85113 100644 --- a/core/modules/package_manager/tests/modules/fixture_manipulator/src/FixtureManipulator.php +++ b/core/modules/package_manager/tests/modules/fixture_manipulator/src/FixtureManipulator.php @@ -442,9 +442,16 @@ protected function getQueuedManipulationItems(): array { protected function runComposerCommand(array $command_options): OutputCallbackInterface { $plain_output = new class() implements OutputCallbackInterface { - // phpcs:ignore DrupalPractice.CodeAnalysis.VariableAnalysis.UnusedVariable + /** + * The standard output for the process. + */ + // phpcs:ignore DrupalPractice.CodeAnalysis.VariableAnalysis.UnusedVariable, Drupal.Commenting.VariableComment.Missing public string $stdout = ''; - // phpcs:ignore DrupalPractice.CodeAnalysis.VariableAnalysis.UnusedVariable + + /** + * The error output for the process. + */ + // phpcs:ignore DrupalPractice.CodeAnalysis.VariableAnalysis.UnusedVariable, Drupal.Commenting.VariableComment.Missing public string $stderr = ''; /** diff --git a/core/modules/package_manager/tests/src/Unit/StageBaseTest.php b/core/modules/package_manager/tests/src/Unit/StageBaseTest.php index 456a0e83e07b..61ff2af58b81 100644 --- a/core/modules/package_manager/tests/src/Unit/StageBaseTest.php +++ b/core/modules/package_manager/tests/src/Unit/StageBaseTest.php @@ -128,7 +128,7 @@ public function testTypeMustBeExplicitlyOverridden(): void { /** * {@inheritdoc} */ - // phpcs:ignore DrupalPractice.CodeAnalysis.VariableAnalysis.UnusedVariable + // phpcs:ignore DrupalPractice.CodeAnalysis.VariableAnalysis.UnusedVariable, Drupal.Commenting.VariableComment.Missing protected string $type = 'package_manager:good_grandchild'; }; @@ -146,6 +146,9 @@ class ChildStage extends StageBase { public function __construct() {} + /** + * {@inheritdoc} + */ protected string $type = 'package_manager:child'; } diff --git a/core/modules/rest/tests/modules/rest_test/src/Plugin/Validation/Constraint/RestTestConstraint.php b/core/modules/rest/tests/modules/rest_test/src/Plugin/Validation/Constraint/RestTestConstraint.php index e5e186e8dd65..a9575b546475 100644 --- a/core/modules/rest/tests/modules/rest_test/src/Plugin/Validation/Constraint/RestTestConstraint.php +++ b/core/modules/rest/tests/modules/rest_test/src/Plugin/Validation/Constraint/RestTestConstraint.php @@ -19,6 +19,9 @@ )] class RestTestConstraint extends SymfonyConstraint { + /** + * The default violation message. + */ public $message = 'REST test validation failed'; } diff --git a/core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/EntityTestCompositeConstraint.php b/core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/EntityTestCompositeConstraint.php index 227020cd5b98..3a46217b5222 100644 --- a/core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/EntityTestCompositeConstraint.php +++ b/core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/EntityTestCompositeConstraint.php @@ -18,6 +18,9 @@ )] class EntityTestCompositeConstraint extends CompositeConstraintBase { + /** + * The default violation message. + */ public $message = 'Multiple fields are validated'; /** diff --git a/core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/EntityTestEntityLevel.php b/core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/EntityTestEntityLevel.php index 99b04d01f0d3..956c032b5d59 100644 --- a/core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/EntityTestEntityLevel.php +++ b/core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/EntityTestEntityLevel.php @@ -18,6 +18,11 @@ )] class EntityTestEntityLevel extends SymfonyConstraint { + /** + * The error message. + * + * @var string + */ public $message = 'Entity level validation'; } diff --git a/core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/FieldWidgetConstraint.php b/core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/FieldWidgetConstraint.php index 7cb72da3b073..9e69c9e4b765 100644 --- a/core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/FieldWidgetConstraint.php +++ b/core/modules/system/tests/modules/entity_test/src/Plugin/Validation/Constraint/FieldWidgetConstraint.php @@ -17,6 +17,9 @@ )] class FieldWidgetConstraint extends SymfonyConstraint { + /** + * The default violation message. + */ public $message = 'Widget constraint has failed.'; } diff --git a/core/modules/system/tests/modules/sdc_other_node_visitor/src/Twig/NodeVisitor/TestNodeVisitor.php b/core/modules/system/tests/modules/sdc_other_node_visitor/src/Twig/NodeVisitor/TestNodeVisitor.php index 637557b40b12..2b3d0b0b3019 100644 --- a/core/modules/system/tests/modules/sdc_other_node_visitor/src/Twig/NodeVisitor/TestNodeVisitor.php +++ b/core/modules/system/tests/modules/sdc_other_node_visitor/src/Twig/NodeVisitor/TestNodeVisitor.php @@ -20,8 +20,14 @@ */ final class TestNodeVisitor implements NodeVisitorInterface { + /** + * The name of the extension. + */ private string $extensionName; + /** + * The variable name. + */ private string $varName; /** diff --git a/core/modules/system/tests/src/Functional/Cache/CacheTestBase.php b/core/modules/system/tests/src/Functional/Cache/CacheTestBase.php index 56ceaae71afd..14bd0846d16d 100644 --- a/core/modules/system/tests/src/Functional/Cache/CacheTestBase.php +++ b/core/modules/system/tests/src/Functional/Cache/CacheTestBase.php @@ -11,8 +11,19 @@ */ abstract class CacheTestBase extends BrowserTestBase { + /** + * The default bin for the cache item. + */ protected $defaultBin = 'render'; + + /** + * The default cache ID. + */ protected $defaultCid = 'test_temporary'; + + /** + * The cache contents default value. + */ protected $defaultValue = 'CacheTest'; /** diff --git a/core/modules/system/tests/src/Functional/FileTransfer/MockTestConnection.php b/core/modules/system/tests/src/Functional/FileTransfer/MockTestConnection.php index 5de24c61fc17..a3b505acd396 100644 --- a/core/modules/system/tests/src/Functional/FileTransfer/MockTestConnection.php +++ b/core/modules/system/tests/src/Functional/FileTransfer/MockTestConnection.php @@ -9,7 +9,14 @@ */ class MockTestConnection { + /** + * The commands to run. + */ protected $commandsRun = []; + + /** + * The database connection. + */ public $connectionString; public function run($cmd) { diff --git a/core/modules/system/tests/src/Functional/Form/UrlTest.php b/core/modules/system/tests/src/Functional/Form/UrlTest.php index ee1d1fc76400..ac6aee19f343 100644 --- a/core/modules/system/tests/src/Functional/Form/UrlTest.php +++ b/core/modules/system/tests/src/Functional/Form/UrlTest.php @@ -19,8 +19,6 @@ class UrlTest extends BrowserTestBase { */ protected static $modules = ['form_test']; - protected $profile = 'testing'; - /** * {@inheritdoc} */ diff --git a/core/modules/system/tests/src/Functional/Module/ModuleTestBase.php b/core/modules/system/tests/src/Functional/Module/ModuleTestBase.php index a5a34cc2630e..18a76bf1c915 100644 --- a/core/modules/system/tests/src/Functional/Module/ModuleTestBase.php +++ b/core/modules/system/tests/src/Functional/Module/ModuleTestBase.php @@ -21,6 +21,9 @@ abstract class ModuleTestBase extends BrowserTestBase { */ protected static $modules = ['system_test']; + /** + * The test user. + */ protected $adminUser; /** diff --git a/core/modules/system/tests/src/Functional/Pager/PagerTest.php b/core/modules/system/tests/src/Functional/Pager/PagerTest.php index 3f46565d049d..9d0cae26b412 100644 --- a/core/modules/system/tests/src/Functional/Pager/PagerTest.php +++ b/core/modules/system/tests/src/Functional/Pager/PagerTest.php @@ -34,8 +34,6 @@ class PagerTest extends BrowserTestBase { */ protected $adminUser; - protected $profile = 'testing'; - /** * {@inheritdoc} */ diff --git a/core/modules/system/tests/src/Functional/System/AccessDeniedTest.php b/core/modules/system/tests/src/Functional/System/AccessDeniedTest.php index 3907ad12cd60..3266b8564881 100644 --- a/core/modules/system/tests/src/Functional/System/AccessDeniedTest.php +++ b/core/modules/system/tests/src/Functional/System/AccessDeniedTest.php @@ -27,6 +27,9 @@ class AccessDeniedTest extends BrowserTestBase { */ protected $defaultTheme = 'stark'; + /** + * The test user. + */ protected $adminUser; /** diff --git a/core/modules/system/tests/src/Functional/System/MainContentFallbackTest.php b/core/modules/system/tests/src/Functional/System/MainContentFallbackTest.php index fa3e318fea3e..f893e5aecfdd 100644 --- a/core/modules/system/tests/src/Functional/System/MainContentFallbackTest.php +++ b/core/modules/system/tests/src/Functional/System/MainContentFallbackTest.php @@ -23,7 +23,14 @@ class MainContentFallbackTest extends BrowserTestBase { */ protected $defaultTheme = 'stark'; + /** + * The administrator user for the test. + */ protected $adminUser; + + /** + * The web user for the test. + */ protected $webUser; /** diff --git a/core/modules/system/tests/src/Functional/System/PageNotFoundTest.php b/core/modules/system/tests/src/Functional/System/PageNotFoundTest.php index 3950822f73da..5a48868682a4 100644 --- a/core/modules/system/tests/src/Functional/System/PageNotFoundTest.php +++ b/core/modules/system/tests/src/Functional/System/PageNotFoundTest.php @@ -27,6 +27,9 @@ class PageNotFoundTest extends BrowserTestBase { */ protected $defaultTheme = 'stark'; + /** + * The test user. + */ protected $adminUser; /** diff --git a/core/modules/system/tests/src/Functional/System/PageTitleTest.php b/core/modules/system/tests/src/Functional/System/PageTitleTest.php index a51362999ca3..0928f535bad2 100644 --- a/core/modules/system/tests/src/Functional/System/PageTitleTest.php +++ b/core/modules/system/tests/src/Functional/System/PageTitleTest.php @@ -26,7 +26,11 @@ class PageTitleTest extends BrowserTestBase { */ protected $defaultTheme = 'starterkit_theme'; + /** + * The test user. + */ protected $contentUser; + protected $savedTitle; /** * Implement setUp(). diff --git a/core/modules/system/tests/src/Functional/System/SiteMaintenanceTest.php b/core/modules/system/tests/src/Functional/System/SiteMaintenanceTest.php index f49b74078f3b..8a34e27c4b0b 100644 --- a/core/modules/system/tests/src/Functional/System/SiteMaintenanceTest.php +++ b/core/modules/system/tests/src/Functional/System/SiteMaintenanceTest.php @@ -30,6 +30,9 @@ class SiteMaintenanceTest extends BrowserTestBase { */ protected $defaultTheme = 'stark'; + /** + * The test user. + */ protected $adminUser; /** diff --git a/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateSystemConfigurationTest.php b/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateSystemConfigurationTest.php index 5ce419d0e4da..2223473e05b0 100644 --- a/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateSystemConfigurationTest.php +++ b/core/modules/system/tests/src/Kernel/Migrate/d6/MigrateSystemConfigurationTest.php @@ -18,6 +18,9 @@ class MigrateSystemConfigurationTest extends MigrateDrupal6TestBase { */ protected static $modules = ['file', 'system']; + /** + * The expected configuration after migration. + */ protected $expectedConfig = [ 'system.cron' => [ 'threshold' => [ diff --git a/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateSystemConfigurationTest.php b/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateSystemConfigurationTest.php index 60a0f2c4af6f..6eb71045f421 100644 --- a/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateSystemConfigurationTest.php +++ b/core/modules/system/tests/src/Kernel/Migrate/d7/MigrateSystemConfigurationTest.php @@ -18,6 +18,9 @@ class MigrateSystemConfigurationTest extends MigrateDrupal7TestBase { */ protected static $modules = ['file', 'system']; + /** + * The expected configuration after migration. + */ protected $expectedConfig = [ 'system.authorize' => [], 'system.cron' => [ diff --git a/core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php b/core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php index 241e1a00a76a..e3745d487755 100644 --- a/core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php +++ b/core/modules/system/tests/src/Unit/Breadcrumbs/PathBasedBreadcrumbBuilderTest.php @@ -432,6 +432,9 @@ protected function setupStubPathProcessor(): void { */ class TestPathBasedBreadcrumbBuilder extends PathBasedBreadcrumbBuilder { + /** + * The test link generator. + */ protected LinkGeneratorInterface $linkGenerator; public function setStringTranslation(TranslationInterface $string_translation) { diff --git a/core/modules/user/tests/src/Kernel/Views/HandlerFilterPermissionTest.php b/core/modules/user/tests/src/Kernel/Views/HandlerFilterPermissionTest.php index afb0c0ae91c9..9cb16c0a901c 100644 --- a/core/modules/user/tests/src/Kernel/Views/HandlerFilterPermissionTest.php +++ b/core/modules/user/tests/src/Kernel/Views/HandlerFilterPermissionTest.php @@ -21,6 +21,7 @@ class HandlerFilterPermissionTest extends UserKernelTestBase { * @var array */ public static $testViews = ['test_filter_permission']; + protected $columnMap; /** * Tests the permission filter handler. diff --git a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/query/QueryTest.php b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/query/QueryTest.php index 00d03c9f0645..c18f139616d2 100644 --- a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/query/QueryTest.php +++ b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/query/QueryTest.php @@ -21,9 +21,25 @@ help: new TranslatableMarkup('Defines a query test plugin.') )] class QueryTest extends QueryPluginBase { + + /** + * The conditions to apply to the query. + */ protected $conditions = []; + + /** + * The list of fields. + */ protected $fields = []; + + /** + * An array of stdClasses. + */ protected $allItems = []; + + /** + * The field to order and the direction. + */ protected $orderBy = []; /** diff --git a/core/modules/views/tests/src/FunctionalJavascript/BlockExposedFilterAJAXTest.php b/core/modules/views/tests/src/FunctionalJavascript/BlockExposedFilterAJAXTest.php index dff279552af7..36a1cf75dcbc 100644 --- a/core/modules/views/tests/src/FunctionalJavascript/BlockExposedFilterAJAXTest.php +++ b/core/modules/views/tests/src/FunctionalJavascript/BlockExposedFilterAJAXTest.php @@ -24,6 +24,9 @@ class BlockExposedFilterAJAXTest extends WebDriverTestBase { */ protected static $modules = ['node', 'views', 'block', 'views_test_config']; + /** + * The views to use for testing. + */ public static $testViews = ['test_block_exposed_ajax', 'test_block_exposed_ajax_with_page']; /** diff --git a/core/modules/views/tests/src/FunctionalJavascript/ClickSortingAJAXTest.php b/core/modules/views/tests/src/FunctionalJavascript/ClickSortingAJAXTest.php index 29cad07068b0..abc6037dd06a 100644 --- a/core/modules/views/tests/src/FunctionalJavascript/ClickSortingAJAXTest.php +++ b/core/modules/views/tests/src/FunctionalJavascript/ClickSortingAJAXTest.php @@ -29,6 +29,9 @@ class ClickSortingAJAXTest extends WebDriverTestBase { */ protected $defaultTheme = 'stark'; + /** + * The views to use for testing. + */ public static $testViews = ['test_content_ajax']; /** diff --git a/core/modules/views/tests/src/FunctionalJavascript/PaginationAJAXTest.php b/core/modules/views/tests/src/FunctionalJavascript/PaginationAJAXTest.php index 5eb53caba9cc..40141d188da6 100644 --- a/core/modules/views/tests/src/FunctionalJavascript/PaginationAJAXTest.php +++ b/core/modules/views/tests/src/FunctionalJavascript/PaginationAJAXTest.php @@ -35,6 +35,9 @@ class PaginationAJAXTest extends WebDriverTestBase { */ public static $testViews = ['test_content_ajax']; + /** + * The test user. + */ protected $user; /** diff --git a/core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php b/core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php index f0dde96d8091..27e53c1c92e7 100644 --- a/core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php +++ b/core/modules/views/tests/src/Unit/Plugin/Derivative/ViewsLocalTaskTest.php @@ -34,6 +34,9 @@ class ViewsLocalTaskTest extends UnitTestCase { */ protected $viewStorage; + /** + * The base definition for the test plugin. + */ protected $baseDefinition = [ 'class' => '\Drupal\views\Plugin\Menu\LocalTask\ViewsLocalTask', 'deriver' => '\Drupal\views\Plugin\Derivative\ViewsLocalTask', @@ -383,6 +386,9 @@ public function testGetDerivativeDefinitionsWithExistingLocalTask(): void { */ class TestViewsLocalTask extends ViewsLocalTask { + /** + * The view result. + */ protected $result; /** diff --git a/core/modules/views_ui/tests/src/FunctionalJavascript/DisplayTest.php b/core/modules/views_ui/tests/src/FunctionalJavascript/DisplayTest.php index f5ad7de3ba70..7fa186986774 100644 --- a/core/modules/views_ui/tests/src/FunctionalJavascript/DisplayTest.php +++ b/core/modules/views_ui/tests/src/FunctionalJavascript/DisplayTest.php @@ -41,6 +41,9 @@ class DisplayTest extends WebDriverTestBase { */ protected $defaultTheme = 'stark'; + /** + * The views used for testing. + */ public static $testViews = ['test_content_ajax', 'test_display']; /** diff --git a/core/modules/workspaces/tests/src/Functional/WorkspaceTestUtilities.php b/core/modules/workspaces/tests/src/Functional/WorkspaceTestUtilities.php index 899dfec2780f..25108d6412fb 100644 --- a/core/modules/workspaces/tests/src/Functional/WorkspaceTestUtilities.php +++ b/core/modules/workspaces/tests/src/Functional/WorkspaceTestUtilities.php @@ -19,6 +19,9 @@ trait WorkspaceTestUtilities { use BlockCreationTrait; + /** + * Signifies that the switcher block is configured. + */ protected $switcherBlockConfigured = FALSE; /** diff --git a/core/phpcs.xml.dist b/core/phpcs.xml.dist index 3bf930d50a45..4534ec882e3b 100644 --- a/core/phpcs.xml.dist +++ b/core/phpcs.xml.dist @@ -112,6 +112,7 @@ <rule ref="Drupal.Commenting.VariableComment.Missing"> <exclude-pattern>./core/tests/*</exclude-pattern> <exclude-pattern>./core/*/tests/*</exclude-pattern> + <include-pattern>core/modules/*/tests/modules/*</include-pattern> </rule> <rule ref="Drupal.ControlStructures.ControlSignature"/> <rule ref="Drupal.ControlStructures.ElseIf"/> diff --git a/core/profiles/minimal/tests/src/Functional/MinimalTest.php b/core/profiles/minimal/tests/src/Functional/MinimalTest.php index cfc5b65b9b11..b0e9d2cbe2a4 100644 --- a/core/profiles/minimal/tests/src/Functional/MinimalTest.php +++ b/core/profiles/minimal/tests/src/Functional/MinimalTest.php @@ -19,6 +19,9 @@ class MinimalTest extends BrowserTestBase { use SchemaCheckTestTrait; use RequirementsPageTrait; + /** + * The profile to use. + */ protected $profile = 'minimal'; /** diff --git a/core/profiles/standard/tests/src/Functional/StandardTest.php b/core/profiles/standard/tests/src/Functional/StandardTest.php index 4bb993ffc947..cc16629b8468 100644 --- a/core/profiles/standard/tests/src/Functional/StandardTest.php +++ b/core/profiles/standard/tests/src/Functional/StandardTest.php @@ -15,6 +15,9 @@ class StandardTest extends BrowserTestBase { use StandardTestTrait; + /** + * The profile to use. + */ protected $profile = 'standard'; } -- GitLab