From 4cdc4313020b75c0355412aab62cbe447aed89ce Mon Sep 17 00:00:00 2001 From: Alex Pott <alex.a.pott@googlemail.com> Date: Sun, 21 Apr 2024 19:57:02 +0100 Subject: [PATCH] Issue #3442295 by mondrake: Change @dataprovider to static in YamlTestBase --- .../Tests/Component/Serialization/YamlTestBase.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/tests/Drupal/Tests/Component/Serialization/YamlTestBase.php b/core/tests/Drupal/Tests/Component/Serialization/YamlTestBase.php index 17dc39947651..573192b02e7f 100644 --- a/core/tests/Drupal/Tests/Component/Serialization/YamlTestBase.php +++ b/core/tests/Drupal/Tests/Component/Serialization/YamlTestBase.php @@ -14,7 +14,7 @@ abstract class YamlTestBase extends TestCase { /** * Some data that should be able to be serialized. */ - public function providerEncodeDecodeTests() { + public static function providerEncodeDecodeTests() { return [ [ 'data' => [ @@ -50,7 +50,7 @@ public function providerEncodeDecodeTests() { /** * Some data that should be able to be deserialized. */ - public function providerDecodeTests() { + public static function providerDecodeTests() { $data = [ // NULL files. ['', NULL], @@ -78,10 +78,10 @@ public function providerDecodeTests() { ]; // 1.2 Bool values. - foreach ($this->providerBoolTest() as $test) { + foreach (static::providerBoolTest() as $test) { $data[] = ['bool: ' . $test[0], ['bool' => $test[1]]]; } - $data = array_merge($data, $this->providerBoolTest()); + $data = array_merge($data, static::providerBoolTest()); return $data; } @@ -89,7 +89,7 @@ public function providerDecodeTests() { /** * Tests different boolean serialization and deserialization. */ - public function providerBoolTest() { + public static function providerBoolTest() { return [ ['true', TRUE], ['TRUE', TRUE], -- GitLab