-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[PhpUnitBridge] Cannot declare class DeepCopy\DeepCopy, because the name is already in use #44426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hello, can you create a small example application that allows to reproduce your issue please? |
@ivoba I cannot reproduce this:
|
I cannot reproduce the error on my side, even in your Docker container. Also in this issue you say the error occurs on PHP 7.4, but the Docker container runs PHP 8.0. |
It happens on both 7.4 and 8.0.
I cleared the test cache hard : Then i run |
Thanks for the further steps to reproduce, I have the error too now. |
The functional test uses the dumped PHP container. During the controller instantiation, the But it already exists and it was included with a different path ( Using PHPUnit directly obvisouly works since the class file path is the same. |
@fancyweb Is there any workaround possible? |
You can set the when@test:
parameters:
container.dumper.inline_class_loader: false I'm closing here because we won't be able to do anything in the short term. |
Uh oh!
There was an error while loading. Please reload this page.
Symfony version(s) affected
5.4.0
Description
When running Functional tests in a symfony project that has DeepCopy as service and dependency this error occurs:
I suppose it is because Phpunit also requires DeepCopy and the PhpUnitBridge somehow mixes dependencies?
The tests outputs the symfony error page.
How to reproduce
Have a project that uses DeepCopy and run a functional test that also uses DeepCopy service f.e in Controller.
Occurs here on PHP7.4 and
<server name="SYMFONY_PHPUNIT_VERSION" value="9.5"/>
Possible Solution
No response
Additional Context
The text was updated successfully, but these errors were encountered: