Closed alexislefebvre closed 5 months ago
There was an issue with the MongoDB test with composer update --prefer-lowest
because it installed doctrine/mongodb-odm-bundle
4.x and there was an error that I can't reproduce.
It randomly appeared when I ran docker-compose exec php-fpm ./vendor/bin/phpunit tests/Test/ConfigMongodbTest.php --debug
several times.
The minimal version for doctrine/mongodb-odm-bundle
is now 5.0
.
Update: here is the error (?):
$ docker-compose exec php-fpm ./vendor/bin/phpunit tests/Test/ConfigMongodbTest.php --debug
PHPUnit Started (PHPUnit 10.5.11 using PHP 8.1.27 (cli) on Linux)
Test Runner Configured
Test Suite Loaded (1 test)
Event Facade Sealed
Test Runner Started
Test Suite Sorted
Test Runner Execution Started (1 test)
Test Suite Started (Liip\Acme\Tests\Test\ConfigMongodbTest, 1 test)
Test Errored (Liip\Acme\Tests\Test\ConfigMongodbTest::testLoadFixturesMongodb)
Deprecated: Return type of Doctrine\ODM\MongoDB\APM\CommandLogger::commandStarted(MongoDB\Driver\Monitoring\CommandStartedEvent $event) should either be compatible with MongoDB\Driver\Monitoring\CommandSubscriber::commandStarted(MongoDB\Driver\Monitoring\CommandStartedEvent $event): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /application/vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/APM/CommandLogger.php on line 47
Deprecated: Return type of Doctrine\ODM\MongoDB\APM\CommandLogger::commandSucceeded(MongoDB\Driver\Monitoring\CommandSucceededEvent $event) should either be compatible with MongoDB\Driver\Monitoring\CommandSubscriber::commandSucceeded(MongoDB\Driver\Monitoring\CommandSucceededEvent $event): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /application/vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/APM/CommandLogger.php on line 52
Deprecated: Return type of Doctrine\ODM\MongoDB\APM\CommandLogger::commandFailed(MongoDB\Driver\Monitoring\CommandFailedEvent $event) should either be compatible with MongoDB\Driver\Monitoring\CommandSubscriber::commandFailed(MongoDB\Driver\Monitoring\CommandFailedEvent $event): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /application/vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/APM/CommandLogger.php on line 62
Test Suite Finished (Liip\Acme\Tests\Test\ConfigMongodbTest, 1 test)
Test Runner Execution Finished
Test Runner Finished
PHPUnit Finished (Shell Exit Code: 2)
We need processIsolation="true"
or #[RunTestsInSeparateProcesses]
because different kernels are loaded, but it hides errors and PHPUnit report successful tests as deprecated instead of success.
There was an issue with the MongoDB test with
composer update --prefer-lowest
because it installeddoctrine/mongodb-odm-bundle
4.x and there was an error that I can't reproduce.It randomly appeared when I ran
docker-compose exec php-fpm ./vendor/bin/phpunit tests/Test/ConfigMongodbTest.php --debug
several times.The minimal version for
doctrine/mongodb-odm-bundle
is now5.0
.
It requires symfony/framework-bundle: ^6.4 || ^7.0
so --prefer-lowest
makes less sense. :grimacing:
The actual error was:
PHPUnit\Framework\Exception: Deprecated: Return type of Doctrine\ODM\MongoDB\APM\CommandLogger::commandStarted(MongoDB\Driver\Monitoring\CommandStartedEvent $event) should either be compatible with MongoDB\Driver\Monitoring\CommandSubscriber::commandStarted(MongoDB\Driver\Monitoring\CommandStartedEvent $event): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /application/vendor/doctrine/mongodb-odm/lib/Doctrine/ODM/MongoDB/APM/CommandLogger.php on line 47
Using "doctrine/mongodb-odm": "^2.5"
fixed the issue.
See:
272