Skip to content

Commit

Permalink
Soft-deprecate getMockBuilder() for #5252
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Feb 24, 2023
1 parent 7d36bee commit cdeb8a5
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .psalm/baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.7.1@8e0fd880141f236847ab49a06f94f788d41a4292">
<files psalm-version="5.7.5@5390c212bab06ee230c8720c2e9c54b823db00c8">
<file src="src/Event/Dispatcher/DirectDispatcher.php">
<UndefinedInterfaceMethod>
<code>notify</code>
Expand Down Expand Up @@ -269,6 +269,11 @@
<code>$originalClassName</code>
<code><![CDATA[$this->expectedException]]></code>
</ArgumentTypeCoercion>
<DeprecatedMethod>
<code>getMockBuilder</code>
<code>getMockBuilder</code>
<code>getMockBuilder</code>
</DeprecatedMethod>
<InvalidReturnStatement>
<code>$mockObject</code>
</InvalidReturnStatement>
Expand Down
10 changes: 10 additions & 0 deletions .psalm/static-analysis-baseline.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.7.5@5390c212bab06ee230c8720c2e9c54b823db00c8">
<file src="tests/static-analysis/TestUsingMocks.php">
<DeprecatedMethod>
<code>createPartialMock</code>
<code>createTestProxy</code>
<code>getMockBuilder</code>
</DeprecatedMethod>
</file>
</files>
1 change: 1 addition & 0 deletions .psalm/static-analysis.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
xmlns="https://getpsalm.org/schema/config"
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
resolveFromConfigFile="false"
errorBaseline=".psalm/static-analysis-baseline.xml"
>
<projectFiles>
<directory name="tests/static-analysis" />
Expand Down
1 change: 1 addition & 0 deletions ChangeLog-10.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@ All notable changes of the PHPUnit 10.1 release series are documented in this fi
* [#5242](https://github.com/sebastianbergmann/phpunit/issues/5242): Deprecate `TestCase::getMockFromWsdl()` (this method only has a `@deprecated` annotation for now; using this method will trigger a deprecation warning in PHPUnit 11; this method will be removed in PHPUnit 12)
* [#5243](https://github.com/sebastianbergmann/phpunit/issues/5243): Deprecate `TestCase::getMockForTrait()` (this method only has a `@deprecated` annotation for now; using this method will trigger a deprecation warning in PHPUnit 11; this method will be removed in PHPUnit 12)
* [#5244](https://github.com/sebastianbergmann/phpunit/issues/5244): Deprecate `TestCase::getObjectForTrait()` (this method only has a `@deprecated` annotation for now; using this method will trigger a deprecation warning in PHPUnit 11; this method will be removed in PHPUnit 12)
* [#5252](https://github.com/sebastianbergmann/phpunit/issues/5252): Deprecate `TestCase::getMockBuilder()` (this method only has a `@deprecated` annotation for now; using this method will trigger a deprecation warning in PHPUnit 11; this method will be removed in PHPUnit 12)

[10.1.0]: https://github.com/sebastianbergmann/phpunit/compare/10.0...main
2 changes: 2 additions & 0 deletions src/Framework/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,8 @@ final public function run(): void
* @psalm-param class-string<RealInstanceType> $className
*
* @psalm-return MockBuilder<RealInstanceType>
*
* @deprecated https://github.com/sebastianbergmann/phpunit/issues/5252
*/
final public function getMockBuilder(string $className): MockBuilder
{
Expand Down

0 comments on commit cdeb8a5

Please sign in to comment.