Skip to content

Commit

Permalink
Closes #5247
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Feb 25, 2024
1 parent 519b64b commit 6f37a53
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 118 deletions.
5 changes: 0 additions & 5 deletions .phpstorm.meta.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,4 @@
\PHPUnit\Framework\TestCase::createTestProxy(0),
map([""=>"$0"])
);

override(
\PHPUnit\Framework\TestCase::getMockForAbstractClass(0),
map([""=>"$0"])
);
}
44 changes: 0 additions & 44 deletions src/Framework/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -1421,50 +1421,6 @@ final protected function createTestProxy(string $originalClassName, array $const
return $testProxy;
}

/**
* Creates a mock object for the specified abstract class with all abstract
* methods of the class mocked. Concrete methods are not mocked by default.
* To mock concrete methods, use the 7th parameter ($mockedMethods).
*
* @psalm-template RealInstanceType of object
*
* @psalm-param class-string<RealInstanceType> $originalClassName
*
* @psalm-return MockObject&RealInstanceType
*
* @throws InvalidArgumentException
* @throws MockObjectException
*
* @deprecated https://github.com/sebastianbergmann/phpunit/issues/5241
*/
final protected function getMockForAbstractClass(string $originalClassName, array $arguments = [], string $mockClassName = '', bool $callOriginalConstructor = true, bool $callOriginalClone = true, bool $callAutoload = true, array $mockedMethods = [], bool $cloneArguments = false): MockObject
{
Event\Facade::emitter()->testTriggeredPhpunitDeprecation(
$this->valueObjectForEvents(),
'getMockForAbstractClass() is deprecated and will be removed in PHPUnit 12 without replacement.',
);

$mockObject = (new MockGenerator)->mockObjectForAbstractClass(
$originalClassName,
$arguments,
$mockClassName,
$callOriginalConstructor,
$callOriginalClone,
$callAutoload,
$mockedMethods,
$cloneArguments,
);

$this->registerMockObject($mockObject);

Event\Facade::emitter()->testCreatedMockObjectForAbstractClass($originalClassName);

assert($mockObject instanceof $originalClassName);
assert($mockObject instanceof MockObject);

return $mockObject;
}

/**
* Creates a mock object based on the given WSDL file.
*
Expand Down

This file was deleted.

0 comments on commit 6f37a53

Please sign in to comment.