doctrine / DoctrineFixturesBundle

Symfony integration for the doctrine/data-fixtures library
MIT License
2.44k stars 202 forks source link

"PHPUnit highest" build fails #367

Closed hlecorche closed 2 years ago

hlecorche commented 2 years ago

See #365 #366

HPUnit 9.5.20 #StandWithUkraine

Warning:       Your XML configuration validates against a deprecated schema.
Suggestion:    Migrate your XML configuration using "--migrate-configuration"!

Testing 
....S......EEEE...                                                18 / 18 (100%)

Time: 00:00.482, Memory: 30.00 MB

There were 4 errors:

1) Doctrine\Bundle\FixturesBundle\Tests\IntegrationTest::testRunCommandWithDefaultPurger
Calling `transactional()` instead of `wrapInTransaction()` which is not implemented on Mock_EntityManagerInterface_69c8e1e4

/home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/vendor/doctrine/orm/lib/Doctrine/ORM/Decorator/EntityManagerDecorator.php:93
/home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/vendor/doctrine/data-fixtures/lib/Doctrine/Common/DataFixtures/Executor/ORMExecutor.php:88
/home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/Command/LoadDataFixturesDoctrineCommand.php:158
/home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/vendor/symfony/console/Command/Command.php:298
/home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/vendor/symfony/console/Tester/CommandTester.php:74
/home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/Tests/IntegrationTest.php:353
phpvfscomposer:///home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/vendor/phpunit/phpunit/phpunit:97

2) Doctrine\Bundle\FixturesBundle\Tests\IntegrationTest::testRunCommandWithPurgeExclusions
Calling `transactional()` instead of `wrapInTransaction()` which is not implemented on Mock_EntityManagerInterface_69c8e1e4

/home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/vendor/doctrine/orm/lib/Doctrine/ORM/Decorator/EntityManagerDecorator.php:93
/home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/vendor/doctrine/data-fixtures/lib/Doctrine/Common/DataFixtures/Executor/ORMExecutor.php:88
/home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/Command/LoadDataFixturesDoctrineCommand.php:158
/home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/vendor/symfony/console/Command/Command.php:298
/home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/vendor/symfony/console/Tester/CommandTester.php:74
/home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/Tests/IntegrationTest.php:400
phpvfscomposer:///home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/vendor/phpunit/phpunit/phpunit:97

3) Doctrine\Bundle\FixturesBundle\Tests\IntegrationTest::testRunCommandWithCustomPurgerAndCustomEntityManager
Calling `transactional()` instead of `wrapInTransaction()` which is not implemented on Mock_EntityManagerInterface_69c8e1e4

/home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/vendor/doctrine/orm/lib/Doctrine/ORM/Decorator/EntityManagerDecorator.php:93
/home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/vendor/doctrine/data-fixtures/lib/Doctrine/Common/DataFixtures/Executor/ORMExecutor.php:88
/home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/Command/LoadDataFixturesDoctrineCommand.php:158
/home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/vendor/symfony/console/Command/Command.php:298
/home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/vendor/symfony/console/Tester/CommandTester.php:74
/home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/Tests/IntegrationTest.php:450
phpvfscomposer:///home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/vendor/phpunit/phpunit/phpunit:97

4) Doctrine\Bundle\FixturesBundle\Tests\IntegrationTest::testRunCommandWithPurgeMode
Calling `transactional()` instead of `wrapInTransaction()` which is not implemented on Mock_EntityManagerInterface_69c8e1e4

/home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/vendor/doctrine/orm/lib/Doctrine/ORM/Decorator/EntityManagerDecorator.php:93
/home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/vendor/doctrine/data-fixtures/lib/Doctrine/Common/DataFixtures/Executor/ORMExecutor.php:88
/home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/Command/LoadDataFixturesDoctrineCommand.php:158
/home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/vendor/symfony/console/Command/Command.php:298
/home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/vendor/symfony/console/Tester/CommandTester.php:74
/home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/Tests/IntegrationTest.php:497
phpvfscomposer:///home/runner/work/DoctrineFixturesBundle/DoctrineFixturesBundle/vendor/phpunit/phpunit/phpunit:97

ERRORS!
Tests: 18, Assertions: 32, Errors: 4, Skipped: 1.

Generating code coverage report in Clover XML format ... done [00:00.004]
Error: Process completed with exit code 2.
greg0ire commented 2 years ago

This is related to https://github.com/doctrine/orm/pull/8419 : the method was introduced as a comment, but is not officially part of the interface, which explains why it is missing from the mock. I wonder if it wouldn't have been better to introduce it as an @method annotation on the interface. Maybe we could avoid some static analysis errors like that. Cc @snapshotpl

Also, I'm working on addressing a deprecation I saw when running the test suite of this bundle in https://github.com/doctrine/data-fixtures/pull/395

greg0ire commented 2 years ago

It's important to note that this failure happens with dev dependencies. It can be reproduced locally by using composer config minimum-stability dev

derrabus commented 2 years ago

@greg0ire It's a bit odd that the ORM emits an E_USER_NOTICE error in this situation. Maybe we should demote that to a deprecation?

derrabus commented 2 years ago

Fixed by #366

greg0ire commented 2 years ago

@derrabus sorry, what E_USER_NOTICE are you referring to?

derrabus commented 2 years ago

https://github.com/doctrine/orm/blob/38d1124be9b51d5ca7ecd86e2fb634797116f48f/lib/Doctrine/ORM/Decorator/EntityManagerDecorator.php#L90-L97