diff --git a/tests/unit/Framework/MockObject/Creation/MockBuilderTest.php b/tests/unit/Framework/MockObject/Creation/MockBuilderTest.php index 1241e0cc9e7..e56c93cdc70 100644 --- a/tests/unit/Framework/MockObject/Creation/MockBuilderTest.php +++ b/tests/unit/Framework/MockObject/Creation/MockBuilderTest.php @@ -9,7 +9,6 @@ */ namespace PHPUnit\Framework\MockObject; -use PHPUnit\TestFixture\MockObject\ClassCallingMethodInConstructor; use function assert; use function class_exists; use function interface_exists; @@ -28,6 +27,7 @@ use PHPUnit\Framework\MockObject\Generator\NameAlreadyInUseException; use PHPUnit\Framework\TestCase; use PHPUnit\TestFixture\MockObject\AbstractClass; +use PHPUnit\TestFixture\MockObject\ClassCallingMethodInConstructor; use PHPUnit\TestFixture\MockObject\ExtendableClass; use PHPUnit\TestFixture\MockObject\InterfaceWithReturnTypeDeclaration; use PHPUnit\TestFixture\MockObject\TraitWithConcreteAndAbstractMethod; @@ -170,11 +170,12 @@ public function testCreatesMockObjectForUnknownType(): void #[TestDox('onlyMethods() mocked methods can be called within the original constructor')] public function testOnlyMethodCalledInConstructorWorks(): void { - $testClassMock = $this->getMockBuilder(ClassCallingMethodInConstructor::class) + $double = $this->getMockBuilder(ClassCallingMethodInConstructor::class) ->onlyMethods(['reset']) ->getMock(); - $testClassMock->expects($this::once())->method('reset'); - $testClassMock->second(); + $double->expects($this->once())->method('reset'); + + $double->second(); } }