Skip to content

Commit

Permalink
Closes #5247
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Jul 19, 2024
1 parent 328f153 commit c720ac6
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 120 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"])
);
}
46 changes: 0 additions & 46 deletions src/Framework/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -1477,52 +1477,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).
*
* @template RealInstanceType of object
*
* @param class-string<RealInstanceType> $originalClassName
* @param array<mixed> $arguments
* @param list<non-empty-string> $mockedMethods
*
* @throws InvalidArgumentException
* @throws MockObjectException
*
* @return MockObject&RealInstanceType
*
* @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 c720ac6

Please sign in to comment.