From d62b69bd430cce80726a0d7e05398f965ce33497 Mon Sep 17 00:00:00 2001 From: Gilles Hoarau Date: Sat, 13 Dec 2025 11:02:48 +0100 Subject: [PATCH 01/15] Upgrade dependencies to support Symfony 8 - Switch Dockerfile to php 8.4 - Add symfony || ^8.0 to composer.json - Update PHP_VERSION_ID limit to 80100 into one test to avoid issue - Fix use of Groups Annotation to Attribute in some tests entities => test:unit success except 1 skipped (proxy) --- Dockerfile | 14 +++++++------- composer.json | 25 +++++++++++++------------ tests/Entity/Comment.php | 2 +- tests/Entity/DummyCustomGroups.php | 2 +- tests/Entity/Page.php | 2 +- tests/Entity/Post.php | 2 +- 6 files changed, 24 insertions(+), 23 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5c57ef4a..1f774da5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,16 @@ -FROM php:8.0-fpm as php +FROM php:8.4-fpm as php COPY --from=composer:latest /usr/bin/composer /usr/bin/composer # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser ENV COMPOSER_ALLOW_SUPERUSER=1 RUN apt-get update && apt-get install -y \ - libfcgi0ldbl \ - zlib1g-dev \ - gettext \ - libzip-dev \ - unzip \ - git + libfcgi0ldbl \ + zlib1g-dev \ + gettext \ + libzip-dev \ + unzip \ + git RUN docker-php-ext-install zip diff --git a/composer.json b/composer.json index 1591a145..9a880346 100644 --- a/composer.json +++ b/composer.json @@ -21,12 +21,13 @@ "php": "^8.1", "ext-json": "*", "meilisearch/meilisearch-php": "^1.16", - "symfony/config": "^6.4 || ^7.0", - "symfony/dependency-injection": "^6.4 || ^7.0", - "symfony/event-dispatcher": "^6.4 || ^7.0", - "symfony/http-kernel": "^6.4 || ^7.0", - "symfony/property-access": "^6.4 || ^7.0", - "symfony/serializer": "^6.4 || ^7.0" + "symfony/config": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/dependency-injection": "^5.4.17 || ^6.0 || ^7.0 || ^8.0", + "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/http-kernel": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/polyfill-php80": "^1.27", + "symfony/property-access": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/serializer": "^5.4 || ^6.0 || ^7.0 || ^8.0" }, "require-dev": { "doctrine/doctrine-bundle": "^2.10 || ^3.0", @@ -43,13 +44,13 @@ "phpstan/phpstan-phpunit": "^2.0.8", "phpstan/phpstan-symfony": "^2.0.8", "phpunit/php-code-coverage": "^9.2.32", - "symfony/doctrine-bridge": "^6.4 || ^7.0", - "symfony/filesystem": "^6.4 || ^7.0", - "symfony/framework-bundle": "^6.4 || ^7.0", - "symfony/http-client": "^6.4.15 || ^7.1.8", + "symfony/doctrine-bridge": "^5.4.19 || ^6.0.7 || ^7.0 || ^8.0", + "symfony/filesystem": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/framework-bundle": "^5.4.17 || ^6.0 || ^7.0 || ^8.0", + "symfony/http-client": "^5.4.47 || ^6.4.15 || ^7.1.8", "symfony/phpunit-bridge": "^7.3", - "symfony/yaml": "^6.4 || ^7.0", - "symfony/var-exporter": "^6.4 || ^7.0" + "symfony/yaml": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/var-exporter": "^5.4 || ^6.0 || ^7.0 || ^8.0" }, "autoload": { "psr-4": { diff --git a/tests/Entity/Comment.php b/tests/Entity/Comment.php index 311fcdfb..f08296c4 100644 --- a/tests/Entity/Comment.php +++ b/tests/Entity/Comment.php @@ -6,7 +6,7 @@ use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; -use Symfony\Component\Serializer\Annotation\Groups; +use Symfony\Component\Serializer\Attribute\Groups; /** * @ORM\Entity diff --git a/tests/Entity/DummyCustomGroups.php b/tests/Entity/DummyCustomGroups.php index d7923584..e95ff396 100644 --- a/tests/Entity/DummyCustomGroups.php +++ b/tests/Entity/DummyCustomGroups.php @@ -6,7 +6,7 @@ use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; -use Symfony\Component\Serializer\Annotation\Groups; +use Symfony\Component\Serializer\Attribute\Groups; /** * @ORM\Entity diff --git a/tests/Entity/Page.php b/tests/Entity/Page.php index 2c30e2d6..b10af8d6 100644 --- a/tests/Entity/Page.php +++ b/tests/Entity/Page.php @@ -7,7 +7,7 @@ use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; use Meilisearch\Bundle\Tests\Entity\ObjectId\DummyObjectId; -use Symfony\Component\Serializer\Annotation\Groups; +use Symfony\Component\Serializer\Attribute\Groups; /** * @ORM\Entity diff --git a/tests/Entity/Post.php b/tests/Entity/Post.php index e2ae2a8e..91a97493 100644 --- a/tests/Entity/Post.php +++ b/tests/Entity/Post.php @@ -8,7 +8,7 @@ use Doctrine\Common\Collections\Collection; use Doctrine\DBAL\Types\Types; use Doctrine\ORM\Mapping as ORM; -use Symfony\Component\Serializer\Annotation\Groups; +use Symfony\Component\Serializer\Attribute\Groups; /** * @ORM\Entity From 28463c4803a79d032ed3e9101ba2a0c092e262fa Mon Sep 17 00:00:00 2001 From: Gilles Hoarau Date: Tue, 16 Dec 2025 12:56:04 +0100 Subject: [PATCH 02/15] =?UTF-8?q?Dropping=20support=20for=20Symfony=205.4?= =?UTF-8?q?=20and=20PHP=20=E2=89=A4=208.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Update php requirement Fix 6.0 to 6.4 for symfony packages --- composer.json | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/composer.json b/composer.json index 9a880346..9eeab01a 100644 --- a/composer.json +++ b/composer.json @@ -21,13 +21,13 @@ "php": "^8.1", "ext-json": "*", "meilisearch/meilisearch-php": "^1.16", - "symfony/config": "^5.4 || ^6.0 || ^7.0 || ^8.0", - "symfony/dependency-injection": "^5.4.17 || ^6.0 || ^7.0 || ^8.0", - "symfony/event-dispatcher": "^5.4 || ^6.0 || ^7.0 || ^8.0", - "symfony/http-kernel": "^5.4 || ^6.0 || ^7.0 || ^8.0", + "symfony/config": "^6.4 || ^7.0 || ^8.0", + "symfony/dependency-injection": "^6.4 || ^7.0 || ^8.0", + "symfony/event-dispatcher": "^6.4 || ^7.0 || ^8.0", + "symfony/http-kernel": "^6.4 || ^7.0 || ^8.0", "symfony/polyfill-php80": "^1.27", - "symfony/property-access": "^5.4 || ^6.0 || ^7.0 || ^8.0", - "symfony/serializer": "^5.4 || ^6.0 || ^7.0 || ^8.0" + "symfony/property-access": "^6.4 || ^7.0 || ^8.0", + "symfony/serializer": "^6.4 || ^7.0 || ^8.0" }, "require-dev": { "doctrine/doctrine-bundle": "^2.10 || ^3.0", @@ -44,13 +44,13 @@ "phpstan/phpstan-phpunit": "^2.0.8", "phpstan/phpstan-symfony": "^2.0.8", "phpunit/php-code-coverage": "^9.2.32", - "symfony/doctrine-bridge": "^5.4.19 || ^6.0.7 || ^7.0 || ^8.0", - "symfony/filesystem": "^5.4 || ^6.0 || ^7.0 || ^8.0", - "symfony/framework-bundle": "^5.4.17 || ^6.0 || ^7.0 || ^8.0", - "symfony/http-client": "^5.4.47 || ^6.4.15 || ^7.1.8", - "symfony/phpunit-bridge": "^7.3", - "symfony/yaml": "^5.4 || ^6.0 || ^7.0 || ^8.0", - "symfony/var-exporter": "^5.4 || ^6.0 || ^7.0 || ^8.0" + "symfony/doctrine-bridge": "^6.4 || ^7.0 || ^8.0", + "symfony/filesystem": "^6.4 || ^7.0 || ^8.0", + "symfony/framework-bundle": "^6.4 || ^7.0 || ^8.0", + "symfony/http-client": "^6.4.15 || ^7.1.8 || ^8.0", + "symfony/phpunit-bridge": "^7.3 || ^8.0", + "symfony/yaml": "^6.4 || ^7.0 || ^8.0", + "symfony/var-exporter": "^6.4 || ^7.0 || ^8.0" }, "autoload": { "psr-4": { From 5b5fe462c801c3007ac01e0e2bad7db95a655a88 Mon Sep 17 00:00:00 2001 From: Gilles Hoarau Date: Wed, 17 Dec 2025 12:32:45 +0100 Subject: [PATCH 03/15] Up to php:8.5-fpm --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 1f774da5..4bbcb61a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.4-fpm as php +FROM php:8.5-fpm as php COPY --from=composer:latest /usr/bin/composer /usr/bin/composer # https://getcomposer.org/doc/03-cli.md#composer-allow-superuser From 8bfdd252909ffa6d63b00fd350001f98606e0729 Mon Sep 17 00:00:00 2001 From: Gilles Hoarau Date: Wed, 17 Dec 2025 12:33:11 +0100 Subject: [PATCH 04/15] Add sf-version 8.0 and exclusion below php8.4 Remove polyfill-php80 Add missing 7.4 --- .github/workflows/pre-release-tests.yml | 10 +++++++++- .github/workflows/tests.yml | 8 +++++++- composer.json | 1 - 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pre-release-tests.yml b/.github/workflows/pre-release-tests.yml index e5a43c78..17dbda66 100644 --- a/.github/workflows/pre-release-tests.yml +++ b/.github/workflows/pre-release-tests.yml @@ -40,7 +40,7 @@ jobs: strategy: matrix: php-version: [ '8.1', '8.2', '8.3', '8.4' ] - sf-version: ['6.4', '7.0', '7.1', '7.2', '7.3' ] + sf-version: ['6.4', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0' ] dependencies: [ 'default' ] exclude: - php-version: '8.1' @@ -51,6 +51,14 @@ jobs: sf-version: '7.2' - php-version: '8.1' sf-version: '7.3' + - php-version: '8.1' + sf-version: '7.4' + - php-version: '8.1' + sf-version: '8.0' + - php-version: '8.2' + sf-version: '8.0' + - php-version: '8.3' + sf-version: '8.0' include: - php-version: '8.4' sf-version: '6.4' diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 25199f4f..9a2c8b5d 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,7 +26,7 @@ jobs: strategy: matrix: php-version: [ '8.1', '8.2', '8.3', '8.4' ] - sf-version: ['6.4', '7.0', '7.1', '7.2', '7.3' ] + sf-version: ['6.4', '7.0', '7.1', '7.2', '7.3', '8.0' ] dependencies: [ 'default' ] exclude: - php-version: '8.1' @@ -37,6 +37,12 @@ jobs: sf-version: '7.2' - php-version: '8.1' sf-version: '7.3' + - php-version: '8.1' + sf-version: '8.0' + - php-version: '8.2' + sf-version: '8.0' + - php-version: '8.3' + sf-version: '8.0' include: - php-version: '8.4' sf-version: '6.4' diff --git a/composer.json b/composer.json index 9eeab01a..10e2feb5 100644 --- a/composer.json +++ b/composer.json @@ -25,7 +25,6 @@ "symfony/dependency-injection": "^6.4 || ^7.0 || ^8.0", "symfony/event-dispatcher": "^6.4 || ^7.0 || ^8.0", "symfony/http-kernel": "^6.4 || ^7.0 || ^8.0", - "symfony/polyfill-php80": "^1.27", "symfony/property-access": "^6.4 || ^7.0 || ^8.0", "symfony/serializer": "^6.4 || ^7.0 || ^8.0" }, From dca54841580e3bd24726752ce98b6d1d82ecd673 Mon Sep 17 00:00:00 2001 From: Gilles Hoarau Date: Wed, 17 Dec 2025 13:08:36 +0100 Subject: [PATCH 05/15] Bump matthiasnoback package to cover symfony 8.0 --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 10e2feb5..ed4fb52c 100644 --- a/composer.json +++ b/composer.json @@ -31,8 +31,8 @@ "require-dev": { "doctrine/doctrine-bundle": "^2.10 || ^3.0", "doctrine/orm": "^2.12 || ^3.0", - "matthiasnoback/symfony-config-test": "^4.3 || ^5.2", - "matthiasnoback/symfony-dependency-injection-test": "^4.3 || ^5.1", + "matthiasnoback/symfony-config-test": "^4.3 || ^5.2 || ^6.1", + "matthiasnoback/symfony-dependency-injection-test": "^4.3 || ^5.1 || ^6.2", "nikic/php-parser": "^5.6.2", "nyholm/psr7": "^1.8.2", "php-cs-fixer/shim": "^3.90.0", From 7d8a783019f0c4ee2ba7e2accaf520bfd7986810 Mon Sep 17 00:00:00 2001 From: Gilles Hoarau Date: Wed, 17 Dec 2025 13:54:52 +0100 Subject: [PATCH 06/15] Bump packages Remove phpmd^2.15 dependency which is not yet compatible with php8.1 Update Requirements section --- README.md | 4 ++-- composer.json | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 86d36977..0d385478 100644 --- a/README.md +++ b/README.md @@ -48,8 +48,8 @@ Say goodbye to server deployment and manual updates with [Meilisearch Cloud](htt ## 📝 Requirements -* **Require** PHP 7.4 and later. -* **Compatible** with Symfony 5.4 and later. +* **Require** PHP 8.1 and later. +* **Compatible** with Symfony 6.4 and later. For support of older versions, see older versions of this bundle. diff --git a/composer.json b/composer.json index ed4fb52c..404ee238 100644 --- a/composer.json +++ b/composer.json @@ -36,13 +36,12 @@ "nikic/php-parser": "^5.6.2", "nyholm/psr7": "^1.8.2", "php-cs-fixer/shim": "^3.90.0", - "phpmd/phpmd": "^2.15", "phpstan/extension-installer": "^1.4.3", "phpstan/phpstan": "^2.1.32", "phpstan/phpstan-doctrine": "^2.0.11", "phpstan/phpstan-phpunit": "^2.0.8", "phpstan/phpstan-symfony": "^2.0.8", - "phpunit/php-code-coverage": "^9.2.32", + "phpunit/php-code-coverage": "^10.1", "symfony/doctrine-bridge": "^6.4 || ^7.0 || ^8.0", "symfony/filesystem": "^6.4 || ^7.0 || ^8.0", "symfony/framework-bundle": "^6.4 || ^7.0 || ^8.0", @@ -69,7 +68,6 @@ } }, "scripts": { - "phpmd": "./vendor/bin/phpmd src text phpmd.xml", "phpstan": "./vendor/bin/phpstan", "test:unit": "SYMFONY_DEPRECATIONS_HELPER='ignoreFile=./tests/baseline-ignore' ./vendor/bin/simple-phpunit --colors=always --verbose", "test:unit:coverage": "SYMFONY_DEPRECATIONS_HELPER='ignoreFile=./tests/baseline-ignore' XDEBUG_MODE=coverage ./vendor/bin/simple-phpunit --colors=always --coverage-html=tests/coverage", From 064c320c3d7657cd880e4ee275ff2e78a0e57bd0 Mon Sep 17 00:00:00 2001 From: Gilles Hoarau Date: Thu, 18 Dec 2025 17:14:26 +0100 Subject: [PATCH 07/15] Replace annotations with attributes TestWith and DataProvider --- .../Command/MeilisearchCreateCommandTest.php | 7 +++---- tests/Unit/ConfigurationTest.php | 12 ++++-------- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/tests/Integration/Command/MeilisearchCreateCommandTest.php b/tests/Integration/Command/MeilisearchCreateCommandTest.php index 32085d00..aa792658 100644 --- a/tests/Integration/Command/MeilisearchCreateCommandTest.php +++ b/tests/Integration/Command/MeilisearchCreateCommandTest.php @@ -6,6 +6,7 @@ use Meilisearch\Bundle\Tests\BaseKernelTestCase; use Meilisearch\Bundle\Tests\Entity\DynamicSettings; +use PHPUnit\Framework\Attributes\TestWith; use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Component\Console\Tester\CommandTester; @@ -29,10 +30,8 @@ public function testExecuteIndexCreation(): void $this->assertSame($this->client->getTasks()->getResults()[0]['type'], 'indexCreation'); } - /** - * @testWith [false] - * [true] - */ + #[TestWith([false])] + #[TestWith([true])] public function testWithoutIndices(bool $updateSettings): void { $createCommand = $this->application->find('meilisearch:create'); diff --git a/tests/Unit/ConfigurationTest.php b/tests/Unit/ConfigurationTest.php index c884d631..ce420ff4 100644 --- a/tests/Unit/ConfigurationTest.php +++ b/tests/Unit/ConfigurationTest.php @@ -6,6 +6,7 @@ use Matthias\SymfonyConfigTest\PhpUnit\ConfigurationTestCaseTrait; use Meilisearch\Bundle\DependencyInjection\Configuration; +use PHPUnit\Framework\Attributes\DataProvider; use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase; final class ConfigurationTest extends KernelTestCase @@ -15,17 +16,14 @@ final class ConfigurationTest extends KernelTestCase /** * @param array $inputConfig * @param array $expectedConfig - * - * @dataProvider dataTestConfigurationTree */ + #[DataProvider('dataTestConfigurationTree')] public function testValidConfig(array $inputConfig, array $expectedConfig): void { $this->assertProcessedConfigurationEquals($inputConfig, $expectedConfig); } - /** - * @dataProvider dataTestSettingsDynamicCheckerInvalid - */ + #[DataProvider('dataTestSettingsDynamicCheckerInvalid')] public function testSettingsDynamicCheckerInvalid(mixed $value): void { $this->assertConfigurationIsInvalid([ @@ -41,9 +39,7 @@ public function testSettingsDynamicCheckerInvalid(mixed $value): void ], 'Settings must be an array.'); } - /** - * @dataProvider dataTestSettingsDynamicCheckerValid - */ + #[DataProvider('dataTestSettingsDynamicCheckerValid')] public function testSettingsDynamicCheckerValid(mixed $value): void { $this->assertConfigurationIsValid([ From b76fb2941db0e7c3c56202d2872b41473faeafe7 Mon Sep 17 00:00:00 2001 From: Gilles Hoarau Date: Thu, 18 Dec 2025 17:15:42 +0100 Subject: [PATCH 08/15] Use vendor/bin/phpunit instead of vendor/bin/simple-phpunit simple-phpunit does not work with phpunit 10 phpunit 10 is required by phpunit/php-code-coverage 10.1 php-code-coverage > 10.1 require php >= 8.2 Update suffix to Test.php to avoid warning Force require phpunit/phpunit 10.5 Remove boostrapFiles used by simple-phpunit --- .github/workflows/tests.yml | 2 +- composer.json | 11 ++++++----- phpstan.dist.neon | 2 -- phpunit.xml.dist | 11 +++++------ 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9a2c8b5d..42251076 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -116,7 +116,7 @@ jobs: - name: PHPStan run: | - vendor/bin/simple-phpunit --version + vendor/bin/phpunit --version composer phpstan yaml-lint: diff --git a/composer.json b/composer.json index 404ee238..9140f6f3 100644 --- a/composer.json +++ b/composer.json @@ -31,8 +31,8 @@ "require-dev": { "doctrine/doctrine-bundle": "^2.10 || ^3.0", "doctrine/orm": "^2.12 || ^3.0", - "matthiasnoback/symfony-config-test": "^4.3 || ^5.2 || ^6.1", - "matthiasnoback/symfony-dependency-injection-test": "^4.3 || ^5.1 || ^6.2", + "matthiasnoback/symfony-config-test": "^6.1", + "matthiasnoback/symfony-dependency-injection-test": "^6.2", "nikic/php-parser": "^5.6.2", "nyholm/psr7": "^1.8.2", "php-cs-fixer/shim": "^3.90.0", @@ -42,11 +42,12 @@ "phpstan/phpstan-phpunit": "^2.0.8", "phpstan/phpstan-symfony": "^2.0.8", "phpunit/php-code-coverage": "^10.1", + "phpunit/phpunit": "^10.5", "symfony/doctrine-bridge": "^6.4 || ^7.0 || ^8.0", "symfony/filesystem": "^6.4 || ^7.0 || ^8.0", "symfony/framework-bundle": "^6.4 || ^7.0 || ^8.0", "symfony/http-client": "^6.4.15 || ^7.1.8 || ^8.0", - "symfony/phpunit-bridge": "^7.3 || ^8.0", + "symfony/phpunit-bridge": "^8.0", "symfony/yaml": "^6.4 || ^7.0 || ^8.0", "symfony/var-exporter": "^6.4 || ^7.0 || ^8.0" }, @@ -69,8 +70,8 @@ }, "scripts": { "phpstan": "./vendor/bin/phpstan", - "test:unit": "SYMFONY_DEPRECATIONS_HELPER='ignoreFile=./tests/baseline-ignore' ./vendor/bin/simple-phpunit --colors=always --verbose", - "test:unit:coverage": "SYMFONY_DEPRECATIONS_HELPER='ignoreFile=./tests/baseline-ignore' XDEBUG_MODE=coverage ./vendor/bin/simple-phpunit --colors=always --coverage-html=tests/coverage", + "test:unit": "SYMFONY_DEPRECATIONS_HELPER='ignoreFile=./tests/baseline-ignore' ./vendor/bin/phpunit --colors=always", + "test:unit:coverage": "SYMFONY_DEPRECATIONS_HELPER='ignoreFile=./tests/baseline-ignore' XDEBUG_MODE=coverage ./vendor/bin/phpunit --colors=always --coverage-html=tests/coverage", "lint:check": "./vendor/bin/php-cs-fixer fix -v --using-cache=no --dry-run", "lint:fix": "./vendor/bin/php-cs-fixer fix -v --using-cache=no" } diff --git a/phpstan.dist.neon b/phpstan.dist.neon index 80765e60..611c275f 100644 --- a/phpstan.dist.neon +++ b/phpstan.dist.neon @@ -2,8 +2,6 @@ includes: - phpstan-baseline.php parameters: - bootstrapFiles: - - vendor/bin/.phpunit/phpunit/vendor/autoload.php level: 5 paths: - src diff --git a/phpunit.xml.dist b/phpunit.xml.dist index d50518cb..1a5432ba 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,12 +1,11 @@ - + src/ - + @@ -14,14 +13,14 @@ - + - tests/Integration + tests/Integration - tests/Unit + tests/Unit From eef06b6fa5aa376a07e46aff534981a060cf7565 Mon Sep 17 00:00:00 2001 From: Gilles Hoarau Date: Fri, 19 Dec 2025 12:12:06 +0100 Subject: [PATCH 09/15] Remove useless phpunit --version Was ran only because in case phpunit was not downloaded --- .github/workflows/tests.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 42251076..c3d61bd1 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -116,7 +116,6 @@ jobs: - name: PHPStan run: | - vendor/bin/phpunit --version composer phpstan yaml-lint: From 755ec9d1f9bb97167b72ba3855990686af7633e8 Mon Sep 17 00:00:00 2001 From: Gilles Hoarau Date: Fri, 19 Dec 2025 12:12:35 +0100 Subject: [PATCH 10/15] Add missing 7.4 --- .github/workflows/tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c3d61bd1..869a44c6 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -26,7 +26,7 @@ jobs: strategy: matrix: php-version: [ '8.1', '8.2', '8.3', '8.4' ] - sf-version: ['6.4', '7.0', '7.1', '7.2', '7.3', '8.0' ] + sf-version: ['6.4', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0' ] dependencies: [ 'default' ] exclude: - php-version: '8.1' @@ -37,6 +37,8 @@ jobs: sf-version: '7.2' - php-version: '8.1' sf-version: '7.3' + - php-version: '8.1' + sf-version: '7.4' - php-version: '8.1' sf-version: '8.0' - php-version: '8.2' From f13c60326bed805bfc2fbb2b22a9ac458072096d Mon Sep 17 00:00:00 2001 From: Gilles Hoarau Date: Fri, 19 Dec 2025 12:29:56 +0100 Subject: [PATCH 11/15] Remove SYMFONY_DEPRECATIONS_HELPER --- composer.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index 9140f6f3..44348bb7 100644 --- a/composer.json +++ b/composer.json @@ -70,8 +70,8 @@ }, "scripts": { "phpstan": "./vendor/bin/phpstan", - "test:unit": "SYMFONY_DEPRECATIONS_HELPER='ignoreFile=./tests/baseline-ignore' ./vendor/bin/phpunit --colors=always", - "test:unit:coverage": "SYMFONY_DEPRECATIONS_HELPER='ignoreFile=./tests/baseline-ignore' XDEBUG_MODE=coverage ./vendor/bin/phpunit --colors=always --coverage-html=tests/coverage", + "test:unit": "./vendor/bin/phpunit --colors=always", + "test:unit:coverage": "XDEBUG_MODE=coverage ./vendor/bin/phpunit --colors=always --coverage-html=tests/coverage", "lint:check": "./vendor/bin/php-cs-fixer fix -v --using-cache=no --dry-run", "lint:fix": "./vendor/bin/php-cs-fixer fix -v --using-cache=no" } From 22536490ab7d2b4504a9c3b6349bc2f8e358eb7f Mon Sep 17 00:00:00 2001 From: Gilles Hoarau Date: Fri, 19 Dec 2025 13:03:17 +0100 Subject: [PATCH 12/15] Add settings to phpunit and source --- phpunit.xml.dist | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 1a5432ba..b43c63fc 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,7 +1,20 @@ - + xsi:noNamespaceSchemaLocation="vendor/bin/.phpunit/phpunit/phpunit.xsd" + displayDetailsOnIncompleteTests="true" + displayDetailsOnPhpunitDeprecations="true" + displayDetailsOnTestsThatTriggerDeprecations="true" + displayDetailsOnTestsThatTriggerErrors="true" + displayDetailsOnTestsThatTriggerNotices="true" + displayDetailsOnTestsThatTriggerWarnings="true" + failOnDeprecation="false" + failOnNotice="true" + failOnWarning="true" + failOnRisky="true"> + src/ From 2bee2173935444bb142d6ab38cea0a1bc6b87262 Mon Sep 17 00:00:00 2001 From: Gilles Hoarau Date: Fri, 19 Dec 2025 13:04:01 +0100 Subject: [PATCH 13/15] Resolve Doctrine auto_mapping deprecation It has to be removed since it will be always false in 4.0 --- tests/Entity/ContentAggregator.php | 5 ----- tests/Entity/EmptyAggregator.php | 5 ----- tests/Kernel.php | 11 ----------- tests/config/doctrine.yaml | 1 - tests/config/doctrine_old_proxy.yaml | 1 - tests/config/doctrine_v2.yaml | 1 - 6 files changed, 24 deletions(-) diff --git a/tests/Entity/ContentAggregator.php b/tests/Entity/ContentAggregator.php index 2346f168..4d5a93b6 100644 --- a/tests/Entity/ContentAggregator.php +++ b/tests/Entity/ContentAggregator.php @@ -4,13 +4,8 @@ namespace Meilisearch\Bundle\Tests\Entity; -use Doctrine\ORM\Mapping as ORM; use Meilisearch\Bundle\Entity\Aggregator; -/** - * @ORM\Entity - */ -#[ORM\Entity] class ContentAggregator extends Aggregator { public function getIsVisible(): bool diff --git a/tests/Entity/EmptyAggregator.php b/tests/Entity/EmptyAggregator.php index ae622370..fa44def4 100644 --- a/tests/Entity/EmptyAggregator.php +++ b/tests/Entity/EmptyAggregator.php @@ -4,13 +4,8 @@ namespace Meilisearch\Bundle\Tests\Entity; -use Doctrine\ORM\Mapping as ORM; use Meilisearch\Bundle\Entity\Aggregator; -/** - * @ORM\Entity - */ -#[ORM\Entity] class EmptyAggregator extends Aggregator { } diff --git a/tests/Kernel.php b/tests/Kernel.php index c4230071..0045b16f 100644 --- a/tests/Kernel.php +++ b/tests/Kernel.php @@ -9,7 +9,6 @@ use Doctrine\Bundle\DoctrineBundle\DoctrineBundle; use Doctrine\ORM\Mapping\LegacyReflectionFields; use Meilisearch\Bundle\MeilisearchBundle; -use Symfony\Bridge\Doctrine\ArgumentResolver\EntityValueResolver; use Symfony\Bundle\FrameworkBundle\FrameworkBundle; use Symfony\Bundle\FrameworkBundle\Kernel\MicroKernelTrait; use Symfony\Component\Config\Loader\LoaderInterface; @@ -51,16 +50,6 @@ protected function configureContainer(ContainerBuilder $container, LoaderInterfa ]); } - if (class_exists(EntityValueResolver::class)) { - $container->prependExtensionConfig('doctrine', [ - 'orm' => [ - 'controller_resolver' => [ - 'auto_mapping' => false, - ], - ], - ]); - } - // @phpstan-ignore-next-line if (Kernel::VERSION_ID >= 70300) { $container->prependExtensionConfig('framework', [ diff --git a/tests/config/doctrine.yaml b/tests/config/doctrine.yaml index ddadaa05..7bc6a6ad 100644 --- a/tests/config/doctrine.yaml +++ b/tests/config/doctrine.yaml @@ -9,7 +9,6 @@ doctrine: dummy_object_id: Meilisearch\Bundle\Tests\Dbal\Type\DummyObjectIdType orm: naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware - auto_mapping: true mappings: App: is_bundle: false diff --git a/tests/config/doctrine_old_proxy.yaml b/tests/config/doctrine_old_proxy.yaml index 55a89891..d0e5c020 100644 --- a/tests/config/doctrine_old_proxy.yaml +++ b/tests/config/doctrine_old_proxy.yaml @@ -10,7 +10,6 @@ doctrine: orm: auto_generate_proxy_classes: true naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware - auto_mapping: true mappings: App: is_bundle: false diff --git a/tests/config/doctrine_v2.yaml b/tests/config/doctrine_v2.yaml index 7abc037c..2694ab8c 100644 --- a/tests/config/doctrine_v2.yaml +++ b/tests/config/doctrine_v2.yaml @@ -11,7 +11,6 @@ doctrine: enable_native_lazy_objects: true auto_generate_proxy_classes: false naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware - auto_mapping: true mappings: App: is_bundle: false From ce065f56e1c361e03b9fa755d5ba1097ccc2ed83 Mon Sep 17 00:00:00 2001 From: Gilles Hoarau Date: Fri, 19 Dec 2025 13:16:45 +0100 Subject: [PATCH 14/15] Patch phpunit and remove phpunit-bridge --- composer.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 44348bb7..fc5ee433 100644 --- a/composer.json +++ b/composer.json @@ -41,13 +41,12 @@ "phpstan/phpstan-doctrine": "^2.0.11", "phpstan/phpstan-phpunit": "^2.0.8", "phpstan/phpstan-symfony": "^2.0.8", - "phpunit/php-code-coverage": "^10.1", - "phpunit/phpunit": "^10.5", + "phpunit/php-code-coverage": "^10.1.16", + "phpunit/phpunit": "^10.5.60", "symfony/doctrine-bridge": "^6.4 || ^7.0 || ^8.0", "symfony/filesystem": "^6.4 || ^7.0 || ^8.0", "symfony/framework-bundle": "^6.4 || ^7.0 || ^8.0", "symfony/http-client": "^6.4.15 || ^7.1.8 || ^8.0", - "symfony/phpunit-bridge": "^8.0", "symfony/yaml": "^6.4 || ^7.0 || ^8.0", "symfony/var-exporter": "^6.4 || ^7.0 || ^8.0" }, From 7147226e28bb21304b8d454085f81b3c9cc1af83 Mon Sep 17 00:00:00 2001 From: Gilles Hoarau Date: Fri, 19 Dec 2025 14:33:49 +0100 Subject: [PATCH 15/15] Remove unuse baseline-ignore --- tests/baseline-ignore | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 tests/baseline-ignore diff --git a/tests/baseline-ignore b/tests/baseline-ignore deleted file mode 100644 index 59ca12be..00000000 --- a/tests/baseline-ignore +++ /dev/null @@ -1,20 +0,0 @@ -%Method "ArrayAccess::offsetGet\(\)" might add "mixed" as a native return type declaration in the future. Do the same in implementation "Meilisearch\\Contracts\\Data" now to avoid errors or add an explicit @return annotation to suppress this message.% -%Since symfony/var-exporter 7.3: The "Symfony\\Component\\VarExporter\\LazyGhostTrait" trait is deprecated, use native lazy objects instead.% -%Since symfony/var-exporter 7.3: Using ProxyHelper::generateLazyGhost\(\) is deprecated, use native lazy objects instead.% -%Class "Doctrine\\ORM\\Proxy\\Autoloader" is deprecated. Use native lazy objects instead.% -%Class "Doctrine\\ORM\\Proxy\\DefaultProxyClassNameResolver" is deprecated. Use native lazy objects instead.% -%Calling Doctrine\\ORM\\Configuration::(setProxyDir|getProxyDir) is deprecated and will not be possible in Doctrine ORM 4.0% -%Calling Doctrine\\ORM\\Configuration::(setAutoGenerateProxyClasses|getAutoGenerateProxyClasses) is deprecated and will not be possible in Doctrine ORM 4.0% -%Calling Doctrine\\ORM\\Configuration::setProxyNamespace is deprecated and will not be possible in Doctrine ORM 4.0% -%Since doctrine/doctrine-bundle 2.16: Not setting "doctrine.orm.enable_native_lazy_objects" to true is deprecated% -%The "report_fields_where_declared" configuration option is deprecated and will be removed in DoctrineBundle 3.0.% -%Implicitly marking parameter \$.+ as nullable is deprecated% -%The "Doctrine\\Bundle\\DoctrineBundle\\CacheWarmer\\DoctrineMetadataCacheWarmer::doWarmUp\(\)" method will require a new "string|null \$buildDir" argument in the next major version of its parent class "Symfony\\Bundle\\FrameworkBundle\\CacheWarmer\\AbstractPhpFileCacheWarmer", not defining it is deprecated% -%Constant E_STRICT is deprecated% -%Method "ArrayAccess::(offsetExists|offsetGet|offsetSet|offsetUnset)\(\)" might add ".+" as a native return type declaration in the future. Do the same in implementation "(Doctrine\\Common\\Collections\\.+|Doctrine\\ORM\\PersistentCollection)" now to avoid errors or add an explicit @return annotation to suppress this message% -%Method "Countable::count\(\)" might add "int" as a native return type declaration in the future. Do the same in implementation "Doctrine\\Common\\Collections\\.+" now to avoid errors or add an explicit @return annotation to suppress this message% -%Method "IteratorAggregate::getIterator\(\)" might add "\\Traversable" as a native return type declaration in the future\. Do the same in implementation "Doctrine\\Common\\Collections\\.+" now to avoid errors or add an explicit @return annotation to suppress this message% -%Return type of Doctrine\\Common\\Collections\\(ArrayCollection|AbstractLazyCollection)::count\(\) should either be compatible with Countable::count\(\): int, or the \#\[\\ReturnTypeWillChange\] attribute should be used to temporarily suppress the notice% -%Return type of Doctrine\\Common\\Collections\\(ArrayCollection|AbstractLazyCollection)::getIterator\(\) should either be compatible with IteratorAggregate::getIterator\(\): Traversable, or the \#\[\\ReturnTypeWillChange\] attribute should be used to temporarily suppress the notice% -%Return type of Doctrine\\Common\\Collections\\(ArrayCollection|AbstractLazyCollection)::(offsetExists|offsetGet|offsetSet|offsetUnset)\(\$offset.*\) should either be compatible with ArrayAccess::(offsetExists|offsetGet|offsetSet|offsetUnset)\(mixed \$offset.*\): .+, or the \#\[\\ReturnTypeWillChange\] attribute should be used to temporarily suppress the notice% -%Since doctrine/doctrine-bundle 3.1: The "auto_mapping" option is deprecated and will be removed in DoctrineBundle 4.0, as it only accepts `false` since 3.0.%