Skip to content

Commit 71bde40

Browse files
Add test
1 parent 58f5d6a commit 71bde40

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
@@ -254,6 +254,18 @@ final public function testOriginalCloneMethodCanOptionallyBeCalledWhenTestDouble
254254
clone $double;
255255
}
256256

257+
public function testMethodNameCanOnlyBeConfiguredOnce(): void
258+
{
259+
$double = $this->createTestDouble(InterfaceWithReturnTypeDeclaration::class);
260+
261+
$this->expectException(MethodNameAlreadyConfiguredException::class);
262+
263+
$double
264+
->method('doSomething')
265+
->method('doSomething')
266+
->willReturn(true);
267+
}
268+
257269
/**
258270
* @psalm-template RealInstanceType of object
259271
*

0 commit comments

Comments
 (0)