From 971dbcfe9230ac010ccf5b032e1fab01c9f25c20 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 3 Jun 2026 19:55:20 +0200 Subject: [PATCH] Fix merge conflict resolution --- .github/workflows/ci.yml | 45 -------------------- tests/EnvironmentTest.php | 1 - tests/Extension/EscaperTest.php | 2 - tests/Extension/SandboxStateChangeTest.php | 1 - tests/Test/DataProviderCompatibilityTest.php | 6 +-- 5 files changed, 1 insertion(+), 54 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 29e6b4716..b9f3067e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,51 +42,6 @@ jobs: - name: "Run tests" run: vendor/bin/phpunit - tests-phpunit-11: - name: "PHP ${{ matrix.php-version }} (PHPUnit 11.3)" - - runs-on: 'ubuntu-latest' - - env: - SYMFONY_PHPUNIT_VERSION: '11.3' - - strategy: - matrix: - php-version: - - '8.2' - - '8.3' - - '8.4' - - steps: - - name: "Checkout code" - uses: actions/checkout@v4 - - - name: "Install PHP with extensions" - uses: shivammathur/setup-php@v2 - with: - coverage: "none" - php-version: ${{ matrix.php-version }} - ini-values: memory_limit=-1 - - - name: "Add PHPUnit matcher" - run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" - - - run: composer install - - - name: "Switch use_yield to true on PHP ${{ matrix.php-version }}" - if: "matrix.php-version == '8.2'" - run: | - sed -i -e "s/'use_yield' => false/'use_yield' => true/" src/Environment.php - - - name: "Install PHPUnit" - run: vendor/bin/simple-phpunit install - - - name: "PHPUnit version" - run: vendor/bin/simple-phpunit --version - - - name: "Run tests" - run: vendor/bin/simple-phpunit - extension-tests: needs: - 'tests' diff --git a/tests/EnvironmentTest.php b/tests/EnvironmentTest.php index 29f4cefa3..eb454f635 100644 --- a/tests/EnvironmentTest.php +++ b/tests/EnvironmentTest.php @@ -20,7 +20,6 @@ namespace Twig\Tests; * file that was distributed with this source code. */ -use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use Twig\Cache\CacheInterface; use Twig\Cache\FilesystemCache; diff --git a/tests/Extension/EscaperTest.php b/tests/Extension/EscaperTest.php index 7b3af9bb6..5470db839 100644 --- a/tests/Extension/EscaperTest.php +++ b/tests/Extension/EscaperTest.php @@ -20,8 +20,6 @@ namespace Twig\Tests; * file that was distributed with this source code. */ -use PHPUnit\Framework\Attributes\DataProvider; -use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use Twig\Extension\EscaperExtension; diff --git a/tests/Extension/SandboxStateChangeTest.php b/tests/Extension/SandboxStateChangeTest.php index c13c7c1c2..1d5376c08 100644 --- a/tests/Extension/SandboxStateChangeTest.php +++ b/tests/Extension/SandboxStateChangeTest.php @@ -11,7 +11,6 @@ namespace Twig\Tests\Extension; -use PHPUnit\Framework\Attributes\Group; use PHPUnit\Framework\TestCase; use Twig\Environment; use Twig\Extension\SandboxExtension; diff --git a/tests/Test/DataProviderCompatibilityTest.php b/tests/Test/DataProviderCompatibilityTest.php index 515c86efb..bc82df2d8 100644 --- a/tests/Test/DataProviderCompatibilityTest.php +++ b/tests/Test/DataProviderCompatibilityTest.php @@ -20,7 +20,7 @@ use Twig\Test\NodeTestCase; * Guards that the shipped test case classes stay usable on PHPUnit >= 11, * which rejects non-static data providers. */ -class DataProviderCompatibilityTest extends TestCase +final class DataProviderCompatibilityTest extends TestCase { /** * @return iterable @@ -32,15 +32,11 @@ class DataProviderCompatibilityTest extends TestCase } /** - * @dataProvider provideTestCaseClasses - * * @param class-string $class */ #[DataProvider('provideTestCaseClasses')] public function testDataProviderAttributesReferenceStaticMethods(string $class): void { - // Read attribute metadata via reflection without instantiating the attribute, - // so the check also runs under PHPUnit < 10 where the attribute class is absent. $found = false; foreach ((new \ReflectionClass($class))->getMethods() as $method) { foreach ($method->getAttributes(DataProvider::class) as $attribute) {