diff --git a/.psalm/baseline.xml b/.psalm/baseline.xml
index 4665a287693..812b61bc500 100644
--- a/.psalm/baseline.xml
+++ b/.psalm/baseline.xml
@@ -905,7 +905,7 @@
getResult
runTest
-
+
endTest
endTest
endTest
@@ -919,6 +919,7 @@
getMockForTrait
getObjectForTrait
new Differ($header)
+ throw new Exception('This test uses TestCase::prophesize(), but phpspec/prophecy is not installed. Please run "composer require --dev phpspec/prophecy".');
$beStrictAboutChangesToGlobalState
diff --git a/ChangeLog-8.5.md b/ChangeLog-8.5.md
index 42b4923edde..04ec1cea919 100644
--- a/ChangeLog-8.5.md
+++ b/ChangeLog-8.5.md
@@ -2,6 +2,12 @@
All notable changes of the PHPUnit 8.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
+## [8.5.29] - 2022-MM-DD
+
+### Changed
+
+* [#5033](https://github.com/sebastianbergmann/phpunit/issues/5033): Do not depend on phpspec/prophecy
+
## [8.5.28] - 2022-07-29
### Fixed
@@ -233,6 +239,7 @@ All notable changes of the PHPUnit 8.5 release series are documented in this fil
* [#3967](https://github.com/sebastianbergmann/phpunit/issues/3967): Cannot double interface that extends interface that extends `\Throwable`
* [#3968](https://github.com/sebastianbergmann/phpunit/pull/3968): Test class run in a separate PHP process are passing when `exit` called inside
+[8.5.29]: https://github.com/sebastianbergmann/phpunit/compare/8.5.28...8.5
[8.5.28]: https://github.com/sebastianbergmann/phpunit/compare/8.5.27...8.5.28
[8.5.27]: https://github.com/sebastianbergmann/phpunit/compare/8.5.26...8.5.27
[8.5.26]: https://github.com/sebastianbergmann/phpunit/compare/8.5.25...8.5.26
diff --git a/build.xml b/build.xml
index 2e5e781fc00..64916192374 100644
--- a/build.xml
+++ b/build.xml
@@ -124,7 +124,30 @@
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -330,6 +353,11 @@
+
+
+
+
+
diff --git a/composer.json b/composer.json
index 88e22906a66..8bcd2a90b89 100644
--- a/composer.json
+++ b/composer.json
@@ -32,7 +32,6 @@
"myclabs/deep-copy": "^1.10.0",
"phar-io/manifest": "^2.0.3",
"phar-io/version": "^3.0.2",
- "phpspec/prophecy": "^1.10.3",
"phpunit/php-code-coverage": "^7.0.12",
"phpunit/php-file-iterator": "^2.0.4",
"phpunit/php-text-template": "^1.2.1",
diff --git a/src/Framework/TestCase.php b/src/Framework/TestCase.php
index 7656a66c0a5..dec0cb3e5a9 100644
--- a/src/Framework/TestCase.php
+++ b/src/Framework/TestCase.php
@@ -1953,6 +1953,10 @@ protected function getObjectForTrait($traitName, array $arguments = [], $traitCl
*/
protected function prophesize($classOrInterface = null): ObjectProphecy
{
+ if (!class_exists(Prophet::class)) {
+ throw new Exception('This test uses TestCase::prophesize(), but phpspec/prophecy is not installed. Please run "composer require --dev phpspec/prophecy".');
+ }
+
if (is_string($classOrInterface)) {
$this->recordDoubledType($classOrInterface);
}