PHPUnit 9.4.3 Fatal error: Trait 'Prophecy\PhpUnit\ProphecyTrait' not found

Created on 15 November 2020, about 4 years ago
Updated 8 January 2024, 12 months ago

Problem/Motivation

An attempt to run php vendor/phpunit/phpunit/phpunit -c web/core web/core/modules/views/tests/src/Unit/Plugin/argument_default/RawTest.php resulted to me with:

Fatal error: Trait 'Prophecy\PhpUnit\ProphecyTrait' not found in D:\wamp\www\d9unit\web\core\tests\Drupal\TestTo
ols\PhpUnitCompatibility\PhpUnit9\TestCompatibilityTrait.php on line 12

Steps to reproduce

This happened to me with latest D9.1.x-dev (e0f0ebc)

Proposed resolution

According to change record Updated to PHPUnit 9
Use composer drupal-phpunit-upgrade See #4 🐛 PHPUnit 9.4.3 Fatal error: Trait 'Prophecy\PhpUnit\ProphecyTrait' not found Fixed

The original proposal, which also worked
The error is fixed for me after I run: composer require phpspec/prophecy-phpunit

So, this dependency might be missing somewhere probably.

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

🐛 Bug report
Status

Fixed

Version

9.1

Component
PHPUnit 

Last updated about 21 hours ago

Created by

🇭🇷Croatia devad

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024