diff --git a/core/phpcs.xml.dist b/core/phpcs.xml.dist index 5cd466001454caade2e90e2b56eb7ecd9553a957..47d0a73e4a306304b9b7b8c42309b20342ec9cf7 100644 --- a/core/phpcs.xml.dist +++ b/core/phpcs.xml.dist @@ -110,7 +110,7 @@ <exclude name="Drupal.Commenting.VariableComment.MissingVar"/> </rule> <rule ref="Drupal.Commenting.VariableComment.Missing"> - <exclude-pattern>./core/tests/*</exclude-pattern> + <include-pattern>./core/tests/*</include-pattern> <exclude-pattern>./core/*/tests/*</exclude-pattern> <include-pattern>core/modules/*/tests/modules/*</include-pattern> </rule> diff --git a/core/tests/Drupal/FunctionalTests/DefaultContent/ContentImportTest.php b/core/tests/Drupal/FunctionalTests/DefaultContent/ContentImportTest.php index e43c7797e22c741604f2c2d32872a5fefcfd0a30..8a3078733c509ebfc67564a243d3b5fad8b1419d 100644 --- a/core/tests/Drupal/FunctionalTests/DefaultContent/ContentImportTest.php +++ b/core/tests/Drupal/FunctionalTests/DefaultContent/ContentImportTest.php @@ -72,6 +72,9 @@ class ContentImportTest extends BrowserTestBase { 'user', ]; + /** + * The directory with the source data. + */ private readonly string $contentDir; /** diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoConfigTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoConfigTest.php index 22be7c48e392823ed1de6dca43891594f2c73b68..4461c06b210683989f581d3635dace943cc6a6e0 100644 --- a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoConfigTest.php +++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigNoConfigTest.php @@ -16,6 +16,9 @@ class InstallerExistingConfigNoConfigTest extends InstallerConfigDirectoryTestBa */ protected $defaultTheme = 'stark'; + /** + * {@inheritdoc} + */ protected $profile = 'no_config_profile'; /** diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigProfileHookInstallTest.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigProfileHookInstallTest.php index 98933d0692754ba0eaf6ceb268c5e1bdce93e1d5..692a9af8730277e79f83131232e80f64420fd425 100644 --- a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigProfileHookInstallTest.php +++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigProfileHookInstallTest.php @@ -11,6 +11,9 @@ */ class InstallerExistingConfigProfileHookInstallTest extends InstallerConfigDirectoryTestBase { + /** + * {@inheritdoc} + */ protected $profile = 'config_profile_with_hook_install'; /** diff --git a/core/tests/Drupal/KernelTests/Core/Action/DeleteActionTest.php b/core/tests/Drupal/KernelTests/Core/Action/DeleteActionTest.php index 9ce189b5df143c7283a953126ad15e401a38df72..35cda2bb5c045dcf7bf54079bf8e9d3993b7abe0 100644 --- a/core/tests/Drupal/KernelTests/Core/Action/DeleteActionTest.php +++ b/core/tests/Drupal/KernelTests/Core/Action/DeleteActionTest.php @@ -15,6 +15,9 @@ */ class DeleteActionTest extends KernelTestBase { + /** + * The test user. + */ protected $testUser; /** diff --git a/core/tests/Drupal/KernelTests/Core/Plugin/PluginTestBase.php b/core/tests/Drupal/KernelTests/Core/Plugin/PluginTestBase.php index 21e5ead9079b77aa0873d327befdf555a75518c8..a6f8dda1ca0dcc18743fb8d30e5e027ae8a6af34 100644 --- a/core/tests/Drupal/KernelTests/Core/Plugin/PluginTestBase.php +++ b/core/tests/Drupal/KernelTests/Core/Plugin/PluginTestBase.php @@ -22,11 +22,34 @@ abstract class PluginTestBase extends KernelTestBase { */ protected static $modules = ['plugin_test']; + /** + * The test plugin manager used by Plugin API unit tests. + */ protected $testPluginManager; + + /** + * The expected plugin definitions for the test plugin. + */ protected $testPluginExpectedDefinitions; + + /** + * The mock plugin manager used by Plugin API derivative unit tests. + */ protected $mockBlockManager; + + /** + * The expected plugin definitions for the mock block plugin. + */ protected $mockBlockExpectedDefinitions; + + /** + * The default plugin manager used by Plugin API unit tests. + */ protected $defaultsTestPluginManager; + + /** + * The expected plugin definitions for the defaults plugin. + */ protected $defaultsTestPluginExpectedDefinitions; /** diff --git a/core/tests/Drupal/KernelTests/Core/Recipe/EntityMethodConfigActionsTest.php b/core/tests/Drupal/KernelTests/Core/Recipe/EntityMethodConfigActionsTest.php index 4b68ee2855c550e3541e4e08808fe8b553fb23f7..8c08c3b8c848adde724af93690dd3202705f8189 100644 --- a/core/tests/Drupal/KernelTests/Core/Recipe/EntityMethodConfigActionsTest.php +++ b/core/tests/Drupal/KernelTests/Core/Recipe/EntityMethodConfigActionsTest.php @@ -20,6 +20,9 @@ class EntityMethodConfigActionsTest extends KernelTestBase { */ protected static $modules = ['config_test', 'entity_test', 'system']; + /** + * The configuration action manager. + */ private readonly ConfigActionManager $configActionManager; /** diff --git a/core/tests/Drupal/KernelTests/Core/Recipe/InputTest.php b/core/tests/Drupal/KernelTests/Core/Recipe/InputTest.php index cd3f14644e9ea7a1bfa7de1dcc767c3ac8483b9f..ad120109c6349368d88ff33e22ee1c2bbbeb9e93 100644 --- a/core/tests/Drupal/KernelTests/Core/Recipe/InputTest.php +++ b/core/tests/Drupal/KernelTests/Core/Recipe/InputTest.php @@ -33,6 +33,9 @@ class InputTest extends KernelTestBase { */ protected static $modules = ['system', 'user']; + /** + * The recipe. + */ private readonly Recipe $recipe; /** diff --git a/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php b/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php index 1cdca5c5dc09306205feab5914aa7e2584c27b73..469f128f09eeb5d4772161e3c445c54eb392ee98 100644 --- a/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php +++ b/core/tests/Drupal/KernelTests/Core/Theme/RegistryTest.php @@ -24,6 +24,9 @@ class RegistryTest extends KernelTestBase { */ protected static $modules = ['theme_test', 'system']; + /** + * The profile to use for this test. + */ protected $profile = 'testing'; /** diff --git a/core/tests/Drupal/Tests/Component/Annotation/PluginTest.php b/core/tests/Drupal/Tests/Component/Annotation/PluginTest.php index a2b6ce7086da8c9aec5d5dc868c9a6ca13d9ba50..dd2db0b7253cf4e6c332c50510e59d07a85a25e4 100644 --- a/core/tests/Drupal/Tests/Component/Annotation/PluginTest.php +++ b/core/tests/Drupal/Tests/Component/Annotation/PluginTest.php @@ -97,6 +97,10 @@ public function testSetClass(): void { * {@inheritdoc} */ class PluginStub extends Plugin { + + /** + * A default property for testing. + */ protected $defaultProperty = 'test_value'; } diff --git a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/ScaffoldTestResult.php b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/ScaffoldTestResult.php index 668665400b22371a2d3de9fffca12d8ba720207f..f44c12ce1d942105467234f0728f482b47c8f922 100644 --- a/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/ScaffoldTestResult.php +++ b/core/tests/Drupal/Tests/Composer/Plugin/Scaffold/ScaffoldTestResult.php @@ -9,7 +9,14 @@ */ class ScaffoldTestResult { + /** + * The location of the scaffold fixture. + */ protected $docroot; + + /** + * The stdout from the test. + */ protected $scaffoldOutput; /** diff --git a/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryCollectorTest.php b/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryCollectorTest.php index cecf44fc3b4e5042d8e0de0bb5344731a8e19815..7d1566d9ff92bd11c848a12f561d8779edfba817 100644 --- a/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryCollectorTest.php +++ b/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryCollectorTest.php @@ -83,6 +83,9 @@ class LibraryDiscoveryCollectorTest extends UnitTestCase { ], ]; + /** + * The active theme. + */ protected $activeTheme; /** diff --git a/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php b/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php index e731afbc6120fe25a1b902f4eed85b23c9de6864..991f7d389daf8c6eae56b77281a9a774bac7da84 100644 --- a/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php +++ b/core/tests/Drupal/Tests/Core/Asset/LibraryDiscoveryParserTest.php @@ -869,6 +869,9 @@ public function testEmptyLibraryFile(): void { */ class TestLibraryDiscoveryParser extends LibraryDiscoveryParser { + /** + * The valid URIs. + */ protected $validUris; protected function fileValidUri($source) { diff --git a/core/tests/Drupal/Tests/Core/Common/TagsTest.php b/core/tests/Drupal/Tests/Core/Common/TagsTest.php index d4fc3a936e2a37c6d18f3a1bac84c80097288072..11f1dc17616e60b99cf44900e863143c022a1d7e 100644 --- a/core/tests/Drupal/Tests/Core/Common/TagsTest.php +++ b/core/tests/Drupal/Tests/Core/Common/TagsTest.php @@ -16,6 +16,9 @@ */ class TagsTest extends UnitTestCase { + /** + * A list of valid tags. + */ protected $validTags = [ 'Drupal' => 'Drupal', 'Drupal with some spaces' => 'Drupal with some spaces', diff --git a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php index 0f9a7e16babfaf9c8dc1b5fc3cd7dbbb09012e88..ccb5f6138dd8d26fbb9e655701edb40ee8a4bd84 100644 --- a/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php +++ b/core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityBaseUnitTest.php @@ -717,10 +717,19 @@ public static function providerTestSetAndPreSaveWithPluginCollections(): array { class TestConfigEntityWithPluginCollections extends ConfigEntityBaseWithPluginCollections { + /** + * The plugin collection. + */ protected $pluginCollection; + /** + * The plugin manager. + */ protected $pluginManager; + /** + * The configuration for the plugin collection. + */ protected array $the_plugin_collection_config = []; public function setPluginManager(PluginManagerInterface $plugin_manager): void { diff --git a/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php b/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php index 4634e966fe986211a1affec457043262603cf80b..a89e2a6f73a51729a2e7ef458180d069023b3582 100644 --- a/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php +++ b/core/tests/Drupal/Tests/Core/Controller/ControllerResolverTest.php @@ -205,6 +205,10 @@ public function getControllerWithRequestAndRouteMatch(RouteMatchInterface $route } class MockContainerInjection implements ContainerInjectionInterface { + + /** + * The test value saved during construction. + */ protected $result; public function __construct($result) { diff --git a/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php b/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php index 3022a966f46ef015c9a192ca786fe93d02e88d7c..74fa24982734b2ebfc32132989b1058d548e6fda 100644 --- a/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php +++ b/core/tests/Drupal/Tests/Core/Entity/KeyValueStore/KeyValueEntityStorageTest.php @@ -61,6 +61,8 @@ class KeyValueEntityStorageTest extends UnitTestCase { protected $languageManager; /** + * The entity storage. + * * @var \Drupal\Core\Entity\KeyValueStore\KeyValueEntityStorage */ protected $entityStorage; @@ -633,11 +635,32 @@ protected function getMockEntity(string $class = EntityBaseTest::class, array $a } class EntityBaseTest extends EntityBase { + + /** + * The entity ID. + */ public $id; + + /** + * The language code for the entity. + */ public $langcode; + + /** + * The entity UUID. + */ public $uuid; + + /** + * The entity label. + */ public $label; + /** + * The original, or NULL if the entity cannot be loaded. + */ + public $original; + } namespace Drupal\Core\Entity\KeyValueStore; diff --git a/core/tests/Drupal/Tests/Core/Entity/StubEntityBase.php b/core/tests/Drupal/Tests/Core/Entity/StubEntityBase.php index 4b7e547920f553c1523a14e198401bc63b605f0d..dce32a895865058da3fd72038c7210a530feca58 100644 --- a/core/tests/Drupal/Tests/Core/Entity/StubEntityBase.php +++ b/core/tests/Drupal/Tests/Core/Entity/StubEntityBase.php @@ -11,9 +11,25 @@ */ class StubEntityBase extends EntityBase { + /** + * The ID for the stub entity. + */ public $id; + + /** + * The language code for the stub entity. + */ + public $langcode; + + /** + * The UUID for the stub entity. + */ public $uuid; + + /** + * The label for the stub entity. + */ public $label; } diff --git a/core/tests/Drupal/Tests/Core/Form/ConfigFormBaseTraitTest.php b/core/tests/Drupal/Tests/Core/Form/ConfigFormBaseTraitTest.php index 318127b121b4defebc922cc6e4b718066d1fa848..292d9ff7991cd14422709f707f9ca20e8334e76b 100644 --- a/core/tests/Drupal/Tests/Core/Form/ConfigFormBaseTraitTest.php +++ b/core/tests/Drupal/Tests/Core/Form/ConfigFormBaseTraitTest.php @@ -71,6 +71,10 @@ public function testConfigFactoryExceptionInvalidProperty(): void { class ConfiguredTrait { use ConfigFormBaseTrait; + + /** + * The configuration factory. + */ public $configFactory; protected function getEditableConfigNames() {} diff --git a/core/tests/Drupal/Tests/Core/Logger/LoggerChannelTest.php b/core/tests/Drupal/Tests/Core/Logger/LoggerChannelTest.php index 718fa92f3ed65058e71e69dd1e90f4c65b1f63ce..31f2f417cbf939314cc848292f876423246f6691 100644 --- a/core/tests/Drupal/Tests/Core/Logger/LoggerChannelTest.php +++ b/core/tests/Drupal/Tests/Core/Logger/LoggerChannelTest.php @@ -188,7 +188,14 @@ function ($context) { class NaughtyRecursiveLogger implements LoggerInterface { use LoggerTrait; + /** + * The logger channel. + */ protected $channel; + + /** + * The message to log. + */ protected $message; public function __construct(LoggerChannel $channel) { diff --git a/core/tests/Drupal/Tests/Core/Menu/MenuLinkMock.php b/core/tests/Drupal/Tests/Core/Menu/MenuLinkMock.php index 82b38aa8f9a793aff4866f7af70ad8e942ae9c24..fa49a1f2001d0597507a4aa48e966e0b436e64fd 100644 --- a/core/tests/Drupal/Tests/Core/Menu/MenuLinkMock.php +++ b/core/tests/Drupal/Tests/Core/Menu/MenuLinkMock.php @@ -12,6 +12,9 @@ */ class MenuLinkMock extends MenuLinkBase { + /** + * The default configuration for the test menu link. + */ protected static $defaults = [ 'menu_name' => 'mock', 'route_name' => 'MUST BE PROVIDED', diff --git a/core/tests/Drupal/Tests/Core/Plugin/FilteredPluginManagerTraitTest.php b/core/tests/Drupal/Tests/Core/Plugin/FilteredPluginManagerTraitTest.php index b7c4e927dc3d8d7d9590200d23689c6e3af741b9..df45f38aeed90665026695a3e37f465af001e093 100644 --- a/core/tests/Drupal/Tests/Core/Plugin/FilteredPluginManagerTraitTest.php +++ b/core/tests/Drupal/Tests/Core/Plugin/FilteredPluginManagerTraitTest.php @@ -85,12 +85,24 @@ class TestFilteredPluginManager extends PluginManagerBase implements FilteredPlu use FilteredPluginManagerTrait; + /** + * An array of plugin definitions. + */ protected $definitions = []; + /** + * The module handler. + */ protected $moduleHandler; + /** + * The theme manager. + */ protected $themeManager; + /** + * The context handler. + */ protected $contextHandler; public function __construct(array $definitions, ModuleHandlerInterface $module_handler, ThemeManagerInterface $theme_manager, ContextHandlerInterface $context_handler) { diff --git a/core/tests/Drupal/Tests/Core/Plugin/PluginDependencyTraitTest.php b/core/tests/Drupal/Tests/Core/Plugin/PluginDependencyTraitTest.php index 8008a80c9466431ebc358aa29fe961b1038525b8..c881b25fbd5379396398d8d51a529c321c372299 100644 --- a/core/tests/Drupal/Tests/Core/Plugin/PluginDependencyTraitTest.php +++ b/core/tests/Drupal/Tests/Core/Plugin/PluginDependencyTraitTest.php @@ -177,8 +177,14 @@ class TestPluginDependency { getPluginDependencies as public; } + /** + * The module handler. + */ protected $moduleHandler; + /** + * The theme handler. + */ protected $themeHandler; public function setModuleHandler(ModuleHandlerInterface $module_handler): void { diff --git a/core/tests/Drupal/Tests/Core/Render/RendererTest.php b/core/tests/Drupal/Tests/Core/Render/RendererTest.php index bdbc2fa87d981cfebbcb4f7f9908ecc13933bbfc..8b1591598768fba6a48e76432e7e60afffc6b26f 100644 --- a/core/tests/Drupal/Tests/Core/Render/RendererTest.php +++ b/core/tests/Drupal/Tests/Core/Render/RendererTest.php @@ -22,6 +22,9 @@ */ class RendererTest extends RendererTestBase { + /** + * The expected theme variables. + */ protected $defaultThemeVars = [ '#cache' => [ 'contexts' => [ diff --git a/core/tests/Drupal/Tests/Core/Render/TestCacheableDependency.php b/core/tests/Drupal/Tests/Core/Render/TestCacheableDependency.php index a73a83aef6df09c16ccacf80c6b49f928eb76329..8465899488a1505f8506278b5b3f239dd4503ba0 100644 --- a/core/tests/Drupal/Tests/Core/Render/TestCacheableDependency.php +++ b/core/tests/Drupal/Tests/Core/Render/TestCacheableDependency.php @@ -11,8 +11,19 @@ */ class TestCacheableDependency implements CacheableDependencyInterface { + /** + * The cache contexts. + */ protected array $contexts; + + /** + * The cache tags. + */ protected array $tags; + + /** + * The cache maximum age. + */ protected $maxAge; public function __construct(array $contexts, array $tags, $max_age) { diff --git a/core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php b/core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php index 9f14175e85dbfb666e88d35d7b1636679e9921e3..b42de0512345138f9668984c32314f220ce576f5 100644 --- a/core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php +++ b/core/tests/Drupal/Tests/Core/Session/AccessPolicyProcessorTest.php @@ -550,6 +550,9 @@ public function getPersistentCacheContexts(): array { class CacheItem { + /** + * The cache data. + */ public $data; public function __construct($data) { diff --git a/core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php b/core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php index e89c0c12fc7503fdd6ef7f21ffaa9ac5903bcd29..4167fa4a30ee233d63f05f0ea68507c7fdca6e3e 100644 --- a/core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php +++ b/core/tests/Drupal/Tests/Core/Template/TwigExtensionTest.php @@ -677,6 +677,9 @@ public static function providerTestTwigSetAttribute(): \Iterator { class TwigExtensionTestString { + /** + * The test string. + */ protected $string; public function __construct($string) { diff --git a/core/tests/Drupal/Tests/Core/Utility/CallableResolverTest.php b/core/tests/Drupal/Tests/Core/Utility/CallableResolverTest.php index 0a5b45102b42c206b224a52935e985b9fe0dfacc..bb340b6099188d116fbb80f60954db08a14c4874 100644 --- a/core/tests/Drupal/Tests/Core/Utility/CallableResolverTest.php +++ b/core/tests/Drupal/Tests/Core/Utility/CallableResolverTest.php @@ -213,6 +213,9 @@ public function __invoke($suffix) { class MockContainerInjection implements ContainerInjectionInterface { + /** + * The value to be injected. + */ protected $injected; public function __construct($result) { diff --git a/core/tests/Drupal/Tests/StreamCapturer.php b/core/tests/Drupal/Tests/StreamCapturer.php index 0f9c8caebc9b46804877826eed4fa9855051c572..86bfec396653d4db27b5d5db07496a03c2af07cb 100644 --- a/core/tests/Drupal/Tests/StreamCapturer.php +++ b/core/tests/Drupal/Tests/StreamCapturer.php @@ -11,6 +11,9 @@ */ class StreamCapturer extends \php_user_filter { + /** + * The cache data. + */ public static $cache = ''; public function filter($in, $out, &$consumed, $closing): int {