From 04ecd41e97b81739ad40fa7fdba1a61035eb238e Mon Sep 17 00:00:00 2001 From: Aaron Gustavo Nieves <64917965+TavoNiievez@users.noreply.github.com> Date: Fri, 26 Jun 2026 19:32:00 -0500 Subject: [PATCH] Update to Symfony 8.1 Bump the highest supported Symfony line from 8.0 to 8.1 across the module: the require-dev constraints, the CI matrix and version-pinning sed, the readme requirements, and the module docblock. symfony/var-exporter needs special handling. Its 8.x release removed the LazyGhost trait (PHP 8.4 ships native lazy objects), and symfony/cache 8.1 requires var-exporter ^8.1, so the Symfony 8.1 row installs var-exporter 8.x for the first time. Two changes keep every matrix row working: * The test app enables Doctrine native lazy objects on PHP 8.4+ (Configuration::enableNativeLazyObjects), since the LazyGhost trait it previously relied on is gone in var-exporter 8.x. * var-exporter keeps a floating constraint (^6.4 | ^7.4 | ^8.1) instead of being pinned to the row version, because doctrine/orm requires it to be >= 6.3.9 and it therefore can never be installed at 5.4.*. Each symfony/cache version still caps it to a compatible range (5.4 -> 6.4, 6.4 -> 7.4, 7.4 -> 8.1, 8.1 -> 8.1). --- .github/workflows/main.yml | 10 ++-- composer.json | 80 +++++++++++++-------------- readme.md | 2 +- src/Codeception/Module/Symfony.php | 2 +- tests/_app/Doctrine/DoctrineSetup.php | 4 ++ 5 files changed, 51 insertions(+), 47 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4be22411..87da0ef7 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,10 +7,10 @@ jobs: strategy: matrix: php: ["8.2", "8.5"] - symfony: ["5.4", "6.4", "7.4", "8.0"] + symfony: ["5.4", "6.4", "7.4", "8.1"] exclude: - php: "8.2" - symfony: "8.0" + symfony: "8.1" steps: - uses: actions/checkout@v6 @@ -35,15 +35,15 @@ jobs: - name: Install dependencies run: | - sed -i "s/\^5.4 | \^6.4 | \^7.4 | \^8.0/${{ matrix.symfony }}.*/g" composer.json + sed -i "s/\^5.4 | \^6.4 | \^7.4 | \^8.1/${{ matrix.symfony }}.*/g" composer.json composer install --prefer-dist --no-progress - name: Quality checks - if: matrix.symfony == '8.0' + if: matrix.symfony == '8.1' run: composer validate --strict && composer audit && composer cs-check && composer phpstan - name: Run module tests - run: vendor/bin/phpunit tests ${{ matrix.symfony == '8.0' && '--coverage-text --coverage-filter src' || '' }} + run: vendor/bin/phpunit tests ${{ matrix.symfony == '8.1' && '--coverage-text --coverage-filter src' || '' }} - name: Prepare Symfony app & run tests run: | diff --git a/composer.json b/composer.json index 2f0975ca..2f274b64 100644 --- a/composer.json +++ b/composer.json @@ -33,46 +33,46 @@ "friendsofphp/php-cs-fixer": "^3.94", "phpstan/phpstan": "^2.2", "phpunit/phpunit": "^11.0 | ^12.0", - "symfony/browser-kit": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/cache": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/clock": "^6.4 | ^7.4 | ^8.0", - "symfony/config": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/console": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/css-selector": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/dependency-injection": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/dom-crawler": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/dotenv": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/error-handler": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/event-dispatcher": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/filesystem": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/finder": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/form": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/framework-bundle": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/http-client": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/http-foundation": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/http-kernel": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/mailer": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/messenger": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/mime": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/notifier": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/options-resolver": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/password-hasher": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/process": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/property-access": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/property-info": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/routing": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/security-bundle": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/security-core": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/security-csrf": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/security-http": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/stopwatch": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/string": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/translation": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/twig-bundle": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/validator": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/var-dumper": "^5.4 | ^6.4 | ^7.4 | ^8.0", - "symfony/var-exporter": "^5.4 | ^6.4 | ^7.4", - "symfony/yaml": "^5.4 | ^6.4 | ^7.4 | ^8.0", + "symfony/browser-kit": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/cache": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/clock": "^6.4 | ^7.4 | ^8.1", + "symfony/config": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/console": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/css-selector": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/dependency-injection": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/dom-crawler": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/dotenv": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/error-handler": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/event-dispatcher": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/filesystem": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/finder": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/form": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/framework-bundle": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/http-client": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/http-foundation": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/http-kernel": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/mailer": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/messenger": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/mime": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/notifier": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/options-resolver": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/password-hasher": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/process": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/property-access": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/property-info": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/routing": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/security-bundle": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/security-core": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/security-csrf": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/security-http": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/stopwatch": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/string": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/translation": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/twig-bundle": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/validator": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/var-dumper": "^5.4 | ^6.4 | ^7.4 | ^8.1", + "symfony/var-exporter": "^6.4 | ^7.4 | ^8.1", + "symfony/yaml": "^5.4 | ^6.4 | ^7.4 | ^8.1", "vlucas/phpdotenv": "^4.2 | ^5.6" }, "suggest": { diff --git a/readme.md b/readme.md index efb2f39e..1a0a673e 100644 --- a/readme.md +++ b/readme.md @@ -9,7 +9,7 @@ A Codeception module for Symfony framework. ## Requirements -* `Symfony` `5.4.x`, `6.4.x`, `7.4.x` or `8.0.x`, as per the [Symfony supported versions](https://symfony.com/releases). +* `Symfony` `5.4.x`, `6.4.x`, `7.4.x` or `8.1.x`, as per the [Symfony supported versions](https://symfony.com/releases). * `PHP 8.2` or higher. ## Installation diff --git a/src/Codeception/Module/Symfony.php b/src/Codeception/Module/Symfony.php index c585d1a5..eecda7f2 100644 --- a/src/Codeception/Module/Symfony.php +++ b/src/Codeception/Module/Symfony.php @@ -80,7 +80,7 @@ * * ## Config * - * ### Symfony 5.4, 6.4, 7.4 or 8.0 + * ### Symfony 5.4, 6.4, 7.4 or 8.1 * * * `app_path`: 'src' - Specify custom path to your app dir, where the kernel interface is located. * * `environment`: 'local' - Environment used for load kernel diff --git a/tests/_app/Doctrine/DoctrineSetup.php b/tests/_app/Doctrine/DoctrineSetup.php index 4d4ecd8f..70327410 100644 --- a/tests/_app/Doctrine/DoctrineSetup.php +++ b/tests/_app/Doctrine/DoctrineSetup.php @@ -42,6 +42,10 @@ public static function createEntityManager(): EntityManagerInterface $config->setProxyNamespace('TestsProxies'); $config->setAutoGenerateProxyClasses(true); + if (PHP_VERSION_ID >= 80400 && method_exists($config, 'enableNativeLazyObjects')) { + $config->enableNativeLazyObjects(true); + } + $connection = DriverManager::getConnection(['driver' => 'pdo_sqlite', 'memory' => true]); if (method_exists(EntityManager::class, 'create')) {