Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastianbergmann committed Jun 8, 2024
1 parent 58f5d6a commit 71bde40
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/unit/Framework/MockObject/TestDoubleTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,18 @@ final public function testOriginalCloneMethodCanOptionallyBeCalledWhenTestDouble
clone $double;
}

public function testMethodNameCanOnlyBeConfiguredOnce(): void
{
$double = $this->createTestDouble(InterfaceWithReturnTypeDeclaration::class);

$this->expectException(MethodNameAlreadyConfiguredException::class);

$double
->method('doSomething')
->method('doSomething')
->willReturn(true);
}

/**
* @psalm-template RealInstanceType of object
*
Expand Down

0 comments on commit 71bde40

Please sign in to comment.