diff --git a/src/Framework/MockObject/MockBuilder.php b/src/Framework/MockObject/MockBuilder.php index b083ba202e7..649d19b5b71 100644 --- a/src/Framework/MockObject/MockBuilder.php +++ b/src/Framework/MockObject/MockBuilder.php @@ -296,7 +296,7 @@ public function addMethods(array $methods): self if ($reflector->hasMethod($method)) { throw new RuntimeException( \sprintf( - 'Trying to set mock method "%s" with addMethods, but it exists in class "%s". Use onlyMethods() for methods that exist in the class.', + 'Trying to set mock method "%s" with addMethods(), but it exists in class "%s". Use onlyMethods() for methods that exist in the class.', $method, $this->type ) diff --git a/tests/unit/Framework/MockObject/MockBuilderTest.php b/tests/unit/Framework/MockObject/MockBuilderTest.php index 8b97496d835..1df6c7dd496 100644 --- a/tests/unit/Framework/MockObject/MockBuilderTest.php +++ b/tests/unit/Framework/MockObject/MockBuilderTest.php @@ -92,7 +92,7 @@ public function testOnlyMethodsWithEmptyArray(): void public function testAddMethodsWithNonExistentMethodNames(): void { $this->expectException(RuntimeException::class); - $this->expectExceptionMessage('Trying to set mock method "mockableMethod" with addMethods, but it exists in class "Mockable". Use onlyMethods() for methods that exist in the class.'); + $this->expectExceptionMessage('Trying to set mock method "mockableMethod" with addMethods(), but it exists in class "Mockable". Use onlyMethods() for methods that exist in the class.'); $this->getMockBuilder(Mockable::class) ->addMethods(['mockableMethod'])