Skip to content

Commit

Permalink
Refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Feb 14, 2024
1 parent b3e7231 commit 4306230
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Framework/MockObject/MockBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function getMock(): MockObject
);

assert($object instanceof $this->type);
assert($object instanceof MockObject);
assert($object instanceof MockObjectInternal);

$this->testCase->registerMockObject($object);

Expand Down
8 changes: 3 additions & 5 deletions src/Framework/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -749,10 +749,8 @@ final public function setResult(mixed $result): void
/**
* @internal This method is not covered by the backward compatibility promise for PHPUnit
*/
final public function registerMockObject(MockObject $mockObject): void
final public function registerMockObject(MockObjectInternal $mockObject): void
{
assert($mockObject instanceof MockObjectInternal);

$this->mockObjects[] = $mockObject;
}

Expand Down Expand Up @@ -1195,7 +1193,7 @@ final protected function createMock(string $originalClassName): MockObject
);

assert($mock instanceof $originalClassName);
assert($mock instanceof MockObject);
assert($mock instanceof MockObjectInternal);

$this->registerMockObject($mock);

Expand All @@ -1217,7 +1215,7 @@ final protected function createMockForIntersectionOfInterfaces(array $interfaces
returnValueGeneration: self::generateReturnValuesForTestDoubles(),
);

assert($mock instanceof MockObject);
assert($mock instanceof MockObjectInternal);

$this->registerMockObject($mock);

Expand Down

0 comments on commit 4306230

Please sign in to comment.