-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Error while running drupal-check : "PHPUnit_Framework_AssertionFailedError," #224
Comments
I hit this error on one project but not another. Both have 8.9.14.. I wonder if there's a dependency conflicting somewhere? |
I worked out the problem: there were some dependencies in the "require-dev" portion of the project's composer.json file which were conflicting, I removed a bunch of them and added "drupal/core-dev" to the project and it worked for me. |
Thanks a lot @damienmckenna! your suggestion worked great for me. The root composer.json had this require-dev section:
Which I manually updated to replace all those constraints with just "drupal/core-dev": "^8 || ^9"; then I used composer to properly resolve the new set of constraints by running:
Which resulted in a require-dev section that looks like this:
After that, I was able to run drupal-check (via drush upgrade_status:analyze my_module) without the error about PHPUnit_Framework_AssertionFailedError. |
phpstan-drupal also had fixes around this. Closing out |
How is drupal-check installed?
drupal-check is installed globally via Composer
Environment:
Describe the bug
Error while running the vendor/bin/drupal-check command
Console output
Warning: Cannot declare class \PHPUnit_Framework_AssertionFailedError, because the name is already in use in /var/www/html/core/tests/bootstrap.php on line 192 Warning: Class 'PHPUnit\Framework\Constraint\Count' not found in /var/www/html/core/tests/bootstrap.php on line 193 Warning: Class 'PHPUnit\Framework\Error\Error' not found in /var/www/html/core/tests/bootstrap.php on line 194 Warning: Class 'PHPUnit\Framework\Error\Warning' not found in /var/www/html/core/tests/bootstrap.php on line 195 Warning: Class 'PHPUnit\Framework\ExpectationFailedException' not found in /var/www/html/core/tests/bootstrap.php on line 196 Warning: Class 'PHPUnit\Framework\Exception' not found in /var/www/html/core/tests/bootstrap.php on line 197 Warning: Class 'PHPUnit\Framework\MockObject\Matcher\InvokedRecorder' not found in /var/www/html/core/tests/bootstrap.php on line 198 Warning: Class 'PHPUnit\Framework\SkippedTestError' not found in /var/www/html/core/tests/bootstrap.php on line 199 Warning: Cannot declare class \PHPUnit_Framework_TestCase, because the name is already in use in /var/www/html/core/tests/bootstrap.php on line 200 Warning: Class 'PHPUnit\Util\Test' not found in /var/www/html/core/tests/bootstrap.php on line 201 Warning: Class 'PHPUnit\Util\Xml' not found in /var/www/html/core/tests/bootstrap.php on line 202 Fatal error: Cannot redeclare Drupal\Tests\PhpunitCompatibilityTrait::setExpectedException() in /var/www/html/core/tests/Drupal/Tests/PhpunitCompatibilityTrait.php on line 141
The text was updated successfully, but these errors were encountered: