Skip to content

Commit

Permalink
Merge branch '8.5' into 9.5
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Aug 22, 2022
2 parents e329ac6 + 5b351a5 commit e0b2338
Show file tree
Hide file tree
Showing 10 changed files with 54 additions and 103 deletions.
29 changes: 25 additions & 4 deletions .psalm/baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -715,7 +715,7 @@
<code>getResult</code>
<code>runTest</code>
</MissingReturnType>
<MissingThrowsDocblock occurrences="19">
<MissingThrowsDocblock occurrences="20">
<code>cacheDirectory</code>
<code>endTest</code>
<code>endTest</code>
Expand All @@ -730,6 +730,7 @@
<code>getMockForTrait</code>
<code>getObjectForTrait</code>
<code>new Differ($header)</code>
<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>
</MissingThrowsDocblock>
<PossiblyNullPropertyAssignmentValue occurrences="3">
<code>$beStrictAboutChangesToGlobalState</code>
Expand All @@ -745,9 +746,6 @@
<code>$runClassInSeparateProcess</code>
<code>$runTestInSeparateProcess</code>
</PropertyNotSetInConstructor>
<RawObjectIteration occurrences="1">
<code>$methodProphecies</code>
</RawObjectIteration>
<RedundantCastGivenDocblockType occurrences="1">
<code>(bool) $this-&gt;backupStaticAttributes</code>
</RedundantCastGivenDocblockType>
Expand All @@ -757,6 +755,22 @@
<RedundantConditionGivenDocblockType occurrences="1">
<code>$this-&gt;prophet !== null</code>
</RedundantConditionGivenDocblockType>
<UndefinedClass occurrences="6">
<code>$e</code>
<code>ObjectProphecy</code>
<code>PredictionException</code>
<code>PredictionException</code>
<code>Prophet</code>
<code>Prophet</code>
</UndefinedClass>
<UndefinedDocblockClass occurrences="6">
<code>$this-&gt;prophet</code>
<code>$this-&gt;prophet</code>
<code>\Prophecy\Exception\Doubler\ClassNotFoundException</code>
<code>\Prophecy\Exception\Doubler\DoubleException</code>
<code>\Prophecy\Exception\Doubler\InterfaceNotFoundException</code>
<code>\Prophecy\Prophet</code>
</UndefinedDocblockClass>
</file>
<file src="src/Framework/TestResult.php">
<ArgumentTypeCoercion occurrences="1">
Expand Down Expand Up @@ -1295,6 +1309,13 @@
</file>
<file src="src/Util/ExcludeList.php">
<MissingThrowsDocblock occurrences="1"/>
<UndefinedClass occurrences="5">
<code>Assert</code>
<code>DocBlock</code>
<code>Project</code>
<code>Prophet</code>
<code>Type</code>
</UndefinedClass>
</file>
<file src="src/Util/Filter.php">
<MissingParamType occurrences="1">
Expand Down
7 changes: 7 additions & 0 deletions ChangeLog-8.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions ChangeLog-9.5.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

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

## [9.5.23] - 2022-MM-DD

### Changed

* [#5033](https://github.com/sebastianbergmann/phpunit/issues/5033): Do not depend on phpspec/prophecy

## [9.5.22] - 2022-08-20

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

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

[9.5.23]: https://github.com/sebastianbergmann/phpunit/compare/9.5.22...9.5
[9.5.22]: https://github.com/sebastianbergmann/phpunit/compare/9.5.21...9.5.22
[9.5.21]: https://github.com/sebastianbergmann/phpunit/compare/9.5.20...9.5.21
[9.5.20]: https://github.com/sebastianbergmann/phpunit/compare/9.5.19...9.5.20
Expand Down
11 changes: 11 additions & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,12 @@
</target>

<target name="-phar-prepare" depends="clean,install-dependencies">
<exec executable="${basedir}/tools/composer" taskname="composer">
<arg value="require"/>
<arg value="phpspec/prophecy"/>
<arg value="^1.12.1"/>
</exec>

<mkdir dir="${basedir}/build/artifacts"/>
<mkdir dir="${basedir}/build/tmp/phar"/>
<mkdir dir="${basedir}/build/tmp/phar-scoped"/>
Expand Down Expand Up @@ -344,6 +350,11 @@
<include name="**/*.php" />
</fileset>
</copy>

<exec executable="${basedir}/tools/composer" taskname="composer">
<arg value="remove"/>
<arg value="phpspec/prophecy"/>
</exec>
</target>

<target name="-phar-build" depends="-phar-determine-version">
Expand Down
4 changes: 0 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
"myclabs/deep-copy": "^1.10.1",
"phar-io/manifest": "^2.0.3",
"phar-io/version": "^3.0.2",
"phpspec/prophecy": "^1.12.1",
"phpunit/php-code-coverage": "^9.2.13",
"phpunit/php-file-iterator": "^3.0.5",
"phpunit/php-invoker": "^3.1.1",
Expand All @@ -50,9 +49,6 @@
"sebastian/type": "^3.0",
"sebastian/version": "^3.0.2"
},
"require-dev": {
"phpspec/prophecy-phpunit": "^2.0.1"
},
"config": {
"platform": {
"php": "7.3.0"
Expand Down
4 changes: 4 additions & 0 deletions src/Framework/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -1954,6 +1954,10 @@ protected function getObjectForTrait(string $traitName, array $arguments = [], s
*/
protected function prophesize(?string $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".');
}

$this->addWarning('PHPUnit\Framework\TestCase::prophesize() is deprecated and will be removed in PHPUnit 10. Please use the trait provided by phpspec/prophecy-phpunit.');

if (is_string($classOrInterface)) {
Expand Down
28 changes: 0 additions & 28 deletions tests/_files/ExternalProphecyIntegrationTest.php

This file was deleted.

25 changes: 0 additions & 25 deletions tests/_files/InternalProphecyIntegrationTest.php

This file was deleted.

18 changes: 0 additions & 18 deletions tests/end-to-end/generic/external-prophecy-integration-test.phpt

This file was deleted.

24 changes: 0 additions & 24 deletions tests/end-to-end/generic/internal-prophecy-integration-test.phpt

This file was deleted.

0 comments on commit e0b2338

Please sign in to comment.