Skip to content

Commit

Permalink
Closes #5249
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Jul 19, 2024
1 parent 79e65fc commit 0839235
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 83 deletions.
39 changes: 0 additions & 39 deletions src/Framework/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -1538,45 +1538,6 @@ final protected function getMockFromWsdl(string $wsdlFile, string $originalClass
return $mockObject;
}

/**
* Creates a mock object for the specified trait with all abstract methods
* of the trait mocked. Concrete methods to mock can be specified with the
* `$mockedMethods` parameter.
*
* @param trait-string $traitName
* @param array<mixed> $arguments
* @param list<non-empty-string> $mockedMethods
*
* @throws InvalidArgumentException
* @throws MockObjectException
*
* @deprecated https://github.com/sebastianbergmann/phpunit/issues/5243
*/
final protected function getMockForTrait(string $traitName, 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(),
'getMockForTrait() is deprecated and will be removed in PHPUnit 12 without replacement.',
);

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

$this->registerMockObject($mockObject);

Event\Facade::emitter()->testCreatedMockObjectForTrait($traitName);

return $mockObject;
}

/**
* Creates an object that uses the specified trait.
*
Expand Down
44 changes: 0 additions & 44 deletions tests/unit/Framework/MockObject/Creation/GetMockForTraitTest.php

This file was deleted.

0 comments on commit 0839235

Please sign in to comment.