From 8a365be7bdc929731b8f93c75470550d1e177b2e Mon Sep 17 00:00:00 2001 From: catch Date: Mon, 22 Apr 2024 16:13:06 +0100 Subject: [PATCH] Issue #3442297 by mondrake: Change @dataprovider to static in DrupalComponentTest (cherry picked from commit ec6476a235da0cb20ec83f36ab623ef203493716) --- core/tests/Drupal/Tests/Component/DrupalComponentTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/tests/Drupal/Tests/Component/DrupalComponentTest.php b/core/tests/Drupal/Tests/Component/DrupalComponentTest.php index 8291c746496..b2566ed752b 100644 --- a/core/tests/Drupal/Tests/Component/DrupalComponentTest.php +++ b/core/tests/Drupal/Tests/Component/DrupalComponentTest.php @@ -38,12 +38,12 @@ class DrupalComponentTest extends TestCase { /** * Tests LICENSE.txt is present and has the correct content. * - * @param $component_path + * @param string $component_path * The path to the component. * - * @dataProvider \Drupal\Tests\Component\DrupalComponentTest::getComponents + * @dataProvider getComponents */ - public function testComponentLicense($component_path) { + public function testComponentLicense(string $component_path): void { $this->assertFileExists($component_path . DIRECTORY_SEPARATOR . 'LICENSE.txt'); $this->assertSame('e84dac1d9fbb5a4a69e38654ce644cea769aa76b', hash_file('sha1', $component_path . DIRECTORY_SEPARATOR . 'LICENSE.txt')); } @@ -53,7 +53,7 @@ class DrupalComponentTest extends TestCase { * * @return array */ - public function getComponents() { + public static function getComponents(): array { $root_component_path = dirname(substr(__DIR__, 0, -strlen(__NAMESPACE__))) . '/lib/Drupal/Component'; $component_paths = []; foreach (new \DirectoryIterator($root_component_path) as $file) {