From d18dbb41417ad7a30463590379b2a271d3d26533 Mon Sep 17 00:00:00 2001 From: Tomas Votruba Date: Wed, 5 Aug 2026 12:00:20 +0200 Subject: [PATCH] [Sets] Update SetManagerTest to the single Twig composer-based set rectorphp/rector-symfony#1010 trims TwigSetProvider to its composer-based trigger, as every rule of the per-version Twig sets is already in it, bound to the twig/twig version it needs. --- tests/Set/SetManager/SetManagerTest.php | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/tests/Set/SetManager/SetManagerTest.php b/tests/Set/SetManager/SetManagerTest.php index 55edca9c1d6..9a29ff4f510 100644 --- a/tests/Set/SetManager/SetManagerTest.php +++ b/tests/Set/SetManager/SetManagerTest.php @@ -20,7 +20,7 @@ public function testMatchComposerTriggered(): void $setManager = $this->createSetManagerWithProjectDirectory(getcwd()); $twigComposerTriggeredSet = $setManager->matchComposerTriggered(SetGroup::TWIG); - $this->assertCount(8, $twigComposerTriggeredSet); + $this->assertCount(1, $twigComposerTriggeredSet); } /** @@ -42,21 +42,13 @@ public function testByVersion(string $projectDirectory, array $expectedSets): vo */ public static function provideInstalledTwigData(): Iterator { - // here we cannot used features coming up in 2.4, as we only have 2.0 - yield [ - __DIR__ . '/Fixture/project-twig-20', - [realpath(TwigSetList::COMPOSER_BASED), realpath(TwigSetList::TWIG_20)], - ]; + // the composer-based set covers every Twig version, as each rule inside it is bound + // to the exact twig/twig version it needs + yield [__DIR__ . '/Fixture/project-twig-20', [realpath(TwigSetList::COMPOSER_BASED)]]; - yield [ - __DIR__ . '/Fixture/project-twig-24', - [realpath(TwigSetList::COMPOSER_BASED), realpath(TwigSetList::TWIG_20), realpath(TwigSetList::TWIG_24)], - ]; + yield [__DIR__ . '/Fixture/project-twig-24', [realpath(TwigSetList::COMPOSER_BASED)]]; - yield [ - __DIR__ . '/Fixture/project-twig-127', - [realpath(TwigSetList::COMPOSER_BASED), realpath(TwigSetList::TWIG_112), realpath(TwigSetList::TWIG_127)], - ]; + yield [__DIR__ . '/Fixture/project-twig-127', [realpath(TwigSetList::COMPOSER_BASED)]]; } private function createSetManagerWithProjectDirectory(string $projectDirectory): SetManager