Skip to content

Commit 0ffd2e6

Browse files
Merge branch '11.2'
2 parents f7664cc + deccf9e commit 0ffd2e6

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/unit/Framework/MockObject/TestDoubleTestCase.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,18 @@ final public function testOriginalCloneMethodCanOptionallyBeCalledWhenTestDouble
281281
clone $double;
282282
}
283283

284+
public function testMethodNameCanOnlyBeConfiguredOnce(): void
285+
{
286+
$double = $this->createTestDouble(InterfaceWithReturnTypeDeclaration::class);
287+
288+
$this->expectException(MethodNameAlreadyConfiguredException::class);
289+
290+
$double
291+
->method('doSomething')
292+
->method('doSomething')
293+
->willReturn(true);
294+
}
295+
284296
/**
285297
* @psalm-template RealInstanceType of object
286298
*

0 commit comments

Comments
 (0)