From 1f24a9f744ca11a54b799444f685274d6c1c204e Mon Sep 17 00:00:00 2001 From: Alexis Lefebvre Date: Sun, 10 Mar 2024 17:20:29 +0100 Subject: [PATCH] chore: remove support of PHP 7.4 and 8.0 --- .github/workflows/tests.yml | 15 ++++----------- composer.json | 8 ++++---- doc/contributing.md | 8 +++++++- phpunit.xml.dist | 1 - tests/Test/ConfigMongodbTest.php | 3 --- 5 files changed, 15 insertions(+), 20 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 02164f52..168552b1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -10,20 +10,14 @@ jobs: strategy: fail-fast: false matrix: - # Symfony 5.4 requires PHP >= 7.2, it will be installed on PHP 7.4 - # Symfony 6.4 requires PHP >= 8.0, it will be installed on PHP >= 8.0 - # Symfony 7.0 requires PHP >= 8.2, it will be installed on PHP >= 8.2 - php-version: ['8.2'] + php-version: [''] composer-flags: [''] symfony-version: [''] mysql-client: [ "default-mysql-client" ] include: - - php-version: 7.4 + - php-version: 8.1 # Use "update" instead of "install" since it allows using the "--prefer-lowest" option composer-flags: "update --prefer-lowest" - - php-version: 7.4 - # add a specific job to test 5.4 for all Symfony packages - symfony-version: "^5.4" - php-version: 8.1 # add a specific job to test ^5.4 for all Symfony packages symfony-version: "^5.4" @@ -34,7 +28,6 @@ jobs: - php-version: 8.2 # add a specific job to test ^6.4 for all Symfony packages symfony-version: "^6.4" - - php-version: 8.2 - php-version: 8.2 symfony-version: "^7.0" - php-version: 8.3 @@ -124,5 +117,5 @@ jobs: - name: Run tests # Run tests twice to ensure that tests are idempotent even if database caching is enabled run: | - php ./vendor/bin/phpunit --testdox - php ./vendor/bin/phpunit --testdox + php ./vendor/bin/phpunit --testdox --process-isolation + php ./vendor/bin/phpunit --testdox --process-isolation diff --git a/composer.json b/composer.json index b83b35f9..2893ebbd 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ } ], "require": { - "php": "^7.4 || ^8.0", + "php": "^8.1", "doctrine/common": "^2.13 || ^3.0", "doctrine/persistence": "^1.3.3 || ^2.0 || ^3.0", "symfony/deprecation-contracts": "^2.1 || ^3.0", @@ -28,14 +28,14 @@ "doctrine/data-fixtures": "^1.7", "doctrine/doctrine-bundle": "^2.11", "doctrine/doctrine-fixtures-bundle": "^3.5.1 || ^4.0", - "doctrine/mongodb-odm-bundle": "^4.2 || ^5.0", + "doctrine/mongodb-odm-bundle": "^4.4 || ^5.0", "doctrine/orm": "^2.7", + "doctrine/mongodb-odm": "^2.5", "monolog/monolog": "^1.25.1 || ^2.0 || ^3.0", - "phpunit/phpunit": "^9.6.17 || ^10.5.11 || ^11.0.4", + "phpunit/phpunit": "^10.5.11 || ^11.0.4", "symfony/doctrine-bridge": "^5.4 || ^6.3 || ^7.0", "symfony/monolog-bridge": "^5.4 || ^6.3 || ^7.0", "symfony/monolog-bundle": "^3.2", - "symfony/phpunit-bridge": "^7.0", "theofidry/alice-data-fixtures": "^1.5.2" }, "conflict": { diff --git a/doc/contributing.md b/doc/contributing.md index 0af22774..7607992c 100644 --- a/doc/contributing.md +++ b/doc/contributing.md @@ -27,7 +27,13 @@ docker-compose exec php-fpm composer update --prefer-lowest Now you can execute the tests with the following command: ```bash -docker-compose exec php-fpm ./vendor/bin/phpunit +docker-compose exec php-fpm ./vendor/bin/phpunit --process-isolation +``` + +If one test fails, run it without the `--process-isolation` option + +```bash +docker-compose exec php-fpm ./vendor/bin/phpunit tests/Test/ConfigMongodbTest.php ``` ## Delete the cache diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 0940f11b..0b975e9d 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -6,7 +6,6 @@ xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" colors="true" beStrictAboutOutputDuringTests="true" - processIsolation="true" > diff --git a/tests/Test/ConfigMongodbTest.php b/tests/Test/ConfigMongodbTest.php index f43de942..a2a7a654 100755 --- a/tests/Test/ConfigMongodbTest.php +++ b/tests/Test/ConfigMongodbTest.php @@ -60,9 +60,6 @@ protected function setUp(): void if (!class_exists(DoctrineMongoDBBundle::class)) { $this->markTestSkipped('Need doctrine/mongodb-odm-bundle package.'); } - if (version_compare(\PHP_VERSION, '8.1.0') < 0) { - $this->markTestSkipped('MongoDB Tests doesn\'t support Outdated PHP Version. <8.1.0'); - } parent::setUp();