Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Oct 19, 2023
1 parent db9ae30 commit 4da7c6c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Framework/MockObject/Runtime/Api/Method.php
Expand Up @@ -21,7 +21,7 @@ trait Method
{
public function method(): InvocationMocker
{
$expects = $this->expects(new AnyInvokedCount);
$expects = $this->__phpunit_getInvocationHandler()->expects(new AnyInvokedCount);

return call_user_func_array(
[$expects, 'method'],
Expand Down
4 changes: 1 addition & 3 deletions src/Framework/MockObject/Runtime/Api/MockObjectApi.php
Expand Up @@ -14,7 +14,6 @@
use PHPUnit\Event\Code\TestMethodBuilder;
use PHPUnit\Event\Facade as EventFacade;
use PHPUnit\Framework\MockObject\Builder\InvocationMocker as InvocationMockerBuilder;
use PHPUnit\Framework\MockObject\Rule\AnyInvokedCount;
use PHPUnit\Framework\MockObject\Rule\InvocationOrder;

/**
Expand Down Expand Up @@ -55,8 +54,7 @@ public function expects(InvocationOrder $matcher): InvocationMockerBuilder
{
assert($this instanceof StubInternal);

if (!$matcher instanceof AnyInvokedCount &&
!$this->__phpunit_wasGeneratedAsMockObject()) {
if (!$this->__phpunit_wasGeneratedAsMockObject()) {
$message = 'Configuring expectations on test doubles that were created as test stubs is deprecated. Support for this will be removed in PHPUnit 12.';

try {
Expand Down

0 comments on commit 4da7c6c

Please sign in to comment.