diff --git a/core/tests/Drupal/Tests/Component/Utility/DeprecationHelperTest.php b/core/tests/Drupal/Tests/Component/Utility/DeprecationHelperTest.php index 5af1ac752a..e97745f614 100644 --- a/core/tests/Drupal/Tests/Component/Utility/DeprecationHelperTest.php +++ b/core/tests/Drupal/Tests/Component/Utility/DeprecationHelperTest.php @@ -13,6 +13,13 @@ */ class DeprecationHelperTest extends TestCase { + protected function currentImplementation() { + return 'current'; + } + + protected function deprecatedImplementation() { + return 'deprecated'; + } /** * @param string $core * The core version to test against. @@ -24,14 +31,10 @@ class DeprecationHelperTest extends TestCase { public function testDeprecationHelper(string $core, array $tests) { foreach ($tests as $version => $expected) { $result = DeprecationHelper::backwardsCompatibleCall( - $core, - $version, - function () { - return 'current'; - }, - function () { - return 'deprecated'; - } + version: $core, + introducedVersion: $version, + current: $this->currentImplementation(...), + deprecated: $this->deprecatedImplementation(...), ); $this->assertEquals($expected, $result, "Change introduced in $version should return $expected for core version $core"); }