Skip to content

Commit e0b2338

Browse files
Merge branch '8.5' into 9.5
2 parents e329ac6 + 5b351a5 commit e0b2338

10 files changed

+54
-103
lines changed

.psalm/baseline.xml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@
715715
<code>getResult</code>
716716
<code>runTest</code>
717717
</MissingReturnType>
718-
<MissingThrowsDocblock occurrences="19">
718+
<MissingThrowsDocblock occurrences="20">
719719
<code>cacheDirectory</code>
720720
<code>endTest</code>
721721
<code>endTest</code>
@@ -730,6 +730,7 @@
730730
<code>getMockForTrait</code>
731731
<code>getObjectForTrait</code>
732732
<code>new Differ($header)</code>
733+
<code>throw new Exception('This test uses TestCase::prophesize(), but phpspec/prophecy is not installed. Please run "composer require --dev phpspec/prophecy ^1.12.1".');</code>
733734
</MissingThrowsDocblock>
734735
<PossiblyNullPropertyAssignmentValue occurrences="3">
735736
<code>$beStrictAboutChangesToGlobalState</code>
@@ -745,9 +746,6 @@
745746
<code>$runClassInSeparateProcess</code>
746747
<code>$runTestInSeparateProcess</code>
747748
</PropertyNotSetInConstructor>
748-
<RawObjectIteration occurrences="1">
749-
<code>$methodProphecies</code>
750-
</RawObjectIteration>
751749
<RedundantCastGivenDocblockType occurrences="1">
752750
<code>(bool) $this-&gt;backupStaticAttributes</code>
753751
</RedundantCastGivenDocblockType>
@@ -757,6 +755,22 @@
757755
<RedundantConditionGivenDocblockType occurrences="1">
758756
<code>$this-&gt;prophet !== null</code>
759757
</RedundantConditionGivenDocblockType>
758+
<UndefinedClass occurrences="6">
759+
<code>$e</code>
760+
<code>ObjectProphecy</code>
761+
<code>PredictionException</code>
762+
<code>PredictionException</code>
763+
<code>Prophet</code>
764+
<code>Prophet</code>
765+
</UndefinedClass>
766+
<UndefinedDocblockClass occurrences="6">
767+
<code>$this-&gt;prophet</code>
768+
<code>$this-&gt;prophet</code>
769+
<code>\Prophecy\Exception\Doubler\ClassNotFoundException</code>
770+
<code>\Prophecy\Exception\Doubler\DoubleException</code>
771+
<code>\Prophecy\Exception\Doubler\InterfaceNotFoundException</code>
772+
<code>\Prophecy\Prophet</code>
773+
</UndefinedDocblockClass>
760774
</file>
761775
<file src="src/Framework/TestResult.php">
762776
<ArgumentTypeCoercion occurrences="1">
@@ -1295,6 +1309,13 @@
12951309
</file>
12961310
<file src="src/Util/ExcludeList.php">
12971311
<MissingThrowsDocblock occurrences="1"/>
1312+
<UndefinedClass occurrences="5">
1313+
<code>Assert</code>
1314+
<code>DocBlock</code>
1315+
<code>Project</code>
1316+
<code>Prophet</code>
1317+
<code>Type</code>
1318+
</UndefinedClass>
12981319
</file>
12991320
<file src="src/Util/Filter.php">
13001321
<MissingParamType occurrences="1">

ChangeLog-8.5.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes of the PHPUnit 8.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
44

5+
## [8.5.29] - 2022-MM-DD
6+
7+
### Changed
8+
9+
* [#5033](https://github.com/sebastianbergmann/phpunit/issues/5033): Do not depend on phpspec/prophecy
10+
511
## [8.5.28] - 2022-07-29
612

713
### Fixed
@@ -233,6 +239,7 @@ All notable changes of the PHPUnit 8.5 release series are documented in this fil
233239
* [#3967](https://github.com/sebastianbergmann/phpunit/issues/3967): Cannot double interface that extends interface that extends `\Throwable`
234240
* [#3968](https://github.com/sebastianbergmann/phpunit/pull/3968): Test class run in a separate PHP process are passing when `exit` called inside
235241

242+
[8.5.29]: https://github.com/sebastianbergmann/phpunit/compare/8.5.28...8.5
236243
[8.5.28]: https://github.com/sebastianbergmann/phpunit/compare/8.5.27...8.5.28
237244
[8.5.27]: https://github.com/sebastianbergmann/phpunit/compare/8.5.26...8.5.27
238245
[8.5.26]: https://github.com/sebastianbergmann/phpunit/compare/8.5.25...8.5.26

ChangeLog-9.5.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes of the PHPUnit 9.5 release series are documented in this file using the [Keep a CHANGELOG](https://keepachangelog.com/) principles.
44

5+
## [9.5.23] - 2022-MM-DD
6+
7+
### Changed
8+
9+
* [#5033](https://github.com/sebastianbergmann/phpunit/issues/5033): Do not depend on phpspec/prophecy
10+
511
## [9.5.22] - 2022-08-20
612

713
### Fixed
@@ -172,6 +178,7 @@ All notable changes of the PHPUnit 9.5 release series are documented in this fil
172178

173179
* [#4535](https://github.com/sebastianbergmann/phpunit/issues/4535): `getMockFromWsdl()` does not handle methods that do not have parameters correctly
174180

181+
[9.5.23]: https://github.com/sebastianbergmann/phpunit/compare/9.5.22...9.5
175182
[9.5.22]: https://github.com/sebastianbergmann/phpunit/compare/9.5.21...9.5.22
176183
[9.5.21]: https://github.com/sebastianbergmann/phpunit/compare/9.5.20...9.5.21
177184
[9.5.20]: https://github.com/sebastianbergmann/phpunit/compare/9.5.19...9.5.20

build.xml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,12 @@
106106
</target>
107107

108108
<target name="-phar-prepare" depends="clean,install-dependencies">
109+
<exec executable="${basedir}/tools/composer" taskname="composer">
110+
<arg value="require"/>
111+
<arg value="phpspec/prophecy"/>
112+
<arg value="^1.12.1"/>
113+
</exec>
114+
109115
<mkdir dir="${basedir}/build/artifacts"/>
110116
<mkdir dir="${basedir}/build/tmp/phar"/>
111117
<mkdir dir="${basedir}/build/tmp/phar-scoped"/>
@@ -344,6 +350,11 @@
344350
<include name="**/*.php" />
345351
</fileset>
346352
</copy>
353+
354+
<exec executable="${basedir}/tools/composer" taskname="composer">
355+
<arg value="remove"/>
356+
<arg value="phpspec/prophecy"/>
357+
</exec>
347358
</target>
348359

349360
<target name="-phar-build" depends="-phar-determine-version">

composer.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
"myclabs/deep-copy": "^1.10.1",
3333
"phar-io/manifest": "^2.0.3",
3434
"phar-io/version": "^3.0.2",
35-
"phpspec/prophecy": "^1.12.1",
3635
"phpunit/php-code-coverage": "^9.2.13",
3736
"phpunit/php-file-iterator": "^3.0.5",
3837
"phpunit/php-invoker": "^3.1.1",
@@ -50,9 +49,6 @@
5049
"sebastian/type": "^3.0",
5150
"sebastian/version": "^3.0.2"
5251
},
53-
"require-dev": {
54-
"phpspec/prophecy-phpunit": "^2.0.1"
55-
},
5652
"config": {
5753
"platform": {
5854
"php": "7.3.0"

src/Framework/TestCase.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1954,6 +1954,10 @@ protected function getObjectForTrait(string $traitName, array $arguments = [], s
19541954
*/
19551955
protected function prophesize(?string $classOrInterface = null): ObjectProphecy
19561956
{
1957+
if (!class_exists(Prophet::class)) {
1958+
throw new Exception('This test uses TestCase::prophesize(), but phpspec/prophecy is not installed. Please run "composer require --dev phpspec/prophecy".');
1959+
}
1960+
19571961
$this->addWarning('PHPUnit\Framework\TestCase::prophesize() is deprecated and will be removed in PHPUnit 10. Please use the trait provided by phpspec/prophecy-phpunit.');
19581962

19591963
if (is_string($classOrInterface)) {

tests/_files/ExternalProphecyIntegrationTest.php

Lines changed: 0 additions & 28 deletions
This file was deleted.

tests/_files/InternalProphecyIntegrationTest.php

Lines changed: 0 additions & 25 deletions
This file was deleted.

tests/end-to-end/generic/external-prophecy-integration-test.phpt

Lines changed: 0 additions & 18 deletions
This file was deleted.

tests/end-to-end/generic/internal-prophecy-integration-test.phpt

Lines changed: 0 additions & 24 deletions
This file was deleted.

0 commit comments

Comments
 (0)