From cc778364701a234087f88d30e355f383b00869f7 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sat, 26 Sep 2026 09:35:14 +0200 Subject: [PATCH] Name the IntegrationTestCase data providers provideTests() and provideLegacyTests() like on 3.x --- CHANGELOG | 1 + src/Test/IntegrationTestCase.php | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 70dcabcdb..829d9fefa 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -9,6 +9,7 @@ * Remove the obsolete `Twig\Test\NodeTestCase::getTests()` method; override `provideTests()` instead * Make `Twig\Markup` final * Remove `getDeprecatingPackage()`, `getDeprecatedVersion()`, and `getAlternative()` from `Twig\TwigCallableInterface` and `Twig\AbstractTwigCallable`; use `Twig\AbstractTwigCallable::triggerDeprecation()` instead + * Remove the `Twig\Test\IntegrationTestCase::getTests()` and `getLegacyTests()` data providers; use `provideTests()` and `provideLegacyTests()` instead * Add native return types to the protected extension points in `Twig\Test\IntegrationTestCase` and `Twig\Test\NodeTestCase` and require overriding methods to declare compatible return types * Remove `TemplateVariable` and `AssignTemplateVariable`; use `MacroVariable` and `AssignMacroVariable` instead * Add the `isAlwaysAllowedInSandbox()` method to `Twig\TwigCallableInterface` and `Twig\TokenParser\TokenParserInterface` diff --git a/src/Test/IntegrationTestCase.php b/src/Test/IntegrationTestCase.php index a4fe9b05f..f828050de 100644 --- a/src/Test/IntegrationTestCase.php +++ b/src/Test/IntegrationTestCase.php @@ -108,13 +108,13 @@ abstract class IntegrationTestCase extends TestCase return []; } - #[DataProvider('getTests')] + #[DataProvider('provideTests')] public function testIntegration($file, $message, $condition, $templates, $exception, $outputs, $deprecation = ''): void { $this->doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs, $deprecation); } - #[DataProvider('getLegacyTests'), Group('legacy'), IgnoreDeprecations] + #[DataProvider('provideLegacyTests'), Group('legacy'), IgnoreDeprecations] public function testLegacyIntegration($file, $message, $condition, $templates, $exception, $outputs, $deprecation = ''): void { $this->doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs, $deprecation); @@ -166,12 +166,12 @@ abstract class IntegrationTestCase extends TestCase return $tests; } - final public static function getTests(): array + final public static function provideTests(): array { return self::assembleTests(false); } - final public static function getLegacyTests(): array + final public static function provideLegacyTests(): array { return self::assembleTests(true); }