Skip to content

Commit

Permalink
Closes #5240
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Oct 13, 2023
1 parent 9855552 commit 5f38b2f
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions ChangeLog-11.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ All notable changes of the PHPUnit 11.0 release series are documented in this fi

### Deprecated

* [#5240](https://github.com/sebastianbergmann/phpunit/issues/5240): `TestCase::createTestProxy()` (this method was already [soft-deprecated](https://phpunit.de/backward-compatibility.html#soft-deprecation) in PHPUnit 10)
* [#5241](https://github.com/sebastianbergmann/phpunit/issues/5241): `TestCase::getMockForAbstractClass()` (this method was already [soft-deprecated](https://phpunit.de/backward-compatibility.html#soft-deprecation) in PHPUnit 10)
* [#5242](https://github.com/sebastianbergmann/phpunit/issues/5242): `TestCase::getMockFromWsdl()` (this method was already [soft-deprecated](https://phpunit.de/backward-compatibility.html#soft-deprecation) in PHPUnit 10)
* [#5243](https://github.com/sebastianbergmann/phpunit/issues/5243): `TestCase::getMockForTrait()` (this method was already [soft-deprecated](https://phpunit.de/backward-compatibility.html#soft-deprecation) in PHPUnit 10)
Expand Down
2 changes: 1 addition & 1 deletion DEPRECATIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ This functionality is currently [soft-deprecated](https://phpunit.de/backward-co

| Issue | Description | Since | Replacement |
|-------------------------------------------------------------------|---------------------------------------------------|--------|-----------------------------------------------------------------------------------------|
| [#5240](https://github.com/sebastianbergmann/phpunit/issues/5240) | `TestCase::createTestProxy()` | 10.1.0 | |
| [#5305](https://github.com/sebastianbergmann/phpunit/issues/5305) | `MockBuilder::getMockForAbstractClass()` | 10.1.0 | |
| [#5306](https://github.com/sebastianbergmann/phpunit/issues/5306) | `MockBuilder::getMockForTrait()` | 10.1.0 | |
| [#5307](https://github.com/sebastianbergmann/phpunit/issues/5307) | `MockBuilder::disableProxyingToOriginalMethods()` | 10.1.0 | |
Expand Down Expand Up @@ -83,6 +82,7 @@ This functionality is currently [hard-deprecated](https://phpunit.de/backward-co

| Issue | Description | Since | Replacement |
|-------------------------------------------------------------------|---------------------------------------|--------|-------------|
| [#5240](https://github.com/sebastianbergmann/phpunit/issues/5240) | `TestCase::createTestProxy()` | 10.1.0 | |
| [#5241](https://github.com/sebastianbergmann/phpunit/issues/5241) | `TestCase::getMockForAbstractClass()` | 10.1.0 | |
| [#5242](https://github.com/sebastianbergmann/phpunit/issues/5242) | `TestCase::getMockFromWsdl()` | 10.1.0 | |
| [#5243](https://github.com/sebastianbergmann/phpunit/issues/5243) | `TestCase::getMockForTrait()` | 10.1.0 | |
Expand Down
5 changes: 5 additions & 0 deletions src/Framework/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -1312,6 +1312,11 @@ final protected function createPartialMock(string $originalClassName, array $met
*/
final protected function createTestProxy(string $originalClassName, array $constructorArguments = []): MockObject
{
Event\Facade::emitter()->testTriggeredPhpunitDeprecation(
$this->valueObjectForEvents(),
'createTestProxy() is deprecated and will be removed in PHPUnit 12. No replacement is/will be provided.',
);

$testProxy = $this->getMockBuilder($originalClassName)
->setConstructorArgs($constructorArguments)
->enableProxyingToOriginalMethods()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use function assert;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\Attributes\IgnorePhpunitDeprecations;
use PHPUnit\Framework\Attributes\Medium;
use PHPUnit\Framework\Attributes\TestDox;
use PHPUnit\Framework\TestCase;
Expand All @@ -21,6 +22,7 @@
#[Group('test-doubles/test-proxy')]
#[Medium]
#[TestDox('createTestProxy()')]
#[IgnorePhpunitDeprecations]
final class CreateTestProxyTest extends TestCase
{
public function testCreatesTestProxyForExtendableClass(): void
Expand Down

0 comments on commit 5f38b2f

Please sign in to comment.