-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Subscriber "PHPUnit\Event\Test\DataProviderMethodCalledSubscriber" does not exist or is not an interface #5570
Comments
It appears that you have different installations of PHPUnit mixed up. For instance, you may have used Composer to install PHPUnit and have configured the autoloader generated by Composer as PHPUnit's bootstrap script but then you invoke PHPUnit using an executable other than |
@sebastianbergmann Thank you for quick reply. Yes I tried to debug based on this input but couldn't find anything. Here is what I did:
Also, please check my Additional Analysis of the issue and if it has anything to do with the issue. |
Thank you for your report. Please provide a minimal, self-contained, reproducing test case that shows the problem you are reporting. Without such a minimal, self-contained, reproducing test case I will not be able to investigate this issue. |
Steps to reproduce:
|
You are configuring Composer to exclude "autoload": {
"exclude-from-classmap": [
"**/Test/**"
]
}, This prevents some of PHPUnit's classes to be found. I do not consider this to be a bug in PHPUnit but rather an incorrect usage of Composer. |
Summary
After upgrading from
phpunit/phpunit": "^9.5"
tophpunit/phpunit": "^10.0"
and running commandvendor/bin/phpunit
getting error as below:I saw multiple issues closed with same error like #5408 and #5417 but skeptical if issue is related to multiple phpunit version mixup or some newly introduced changes.
Additional Analysis
As per my current analysis, I am getting error when upgrading from phpunit 9 to 10 and my composer.json file contains autoload section as below:
But when I remove
**/Test/**
from above block, command works fine. Looks likephpunit/phpunit/src/Event/TypeMap.php
is missing some of required classes when performing mapping.Note: Adding
**/Test/**
is important from performance's perspective so removing it might not be best idea.It would be great if someone can help with this or provide some more info if this is indeed related to multiple
phpunit
versions mixup.The text was updated successfully, but these errors were encountered: