Skip to content

Commit

Permalink
Fix type hint of $methodNames argument in MockInterface.stub
Browse files Browse the repository at this point in the history
  • Loading branch information
wimski authored and ondrejmirtes committed Dec 14, 2020
1 parent a3a1b7e commit 6e8917e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stubs/MockInterface.stub
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface MockInterface
{

/**
* @param string[] ...$methodNames
* @param string|array<string, mixed> ...$methodNames
* @return Expectation
*/
public function shouldReceive(...$methodNames);
Expand All @@ -22,7 +22,7 @@ interface LegacyMockInterface
{

/**
* @param string[] ...$methodNames
* @param string|array<string, mixed> ...$methodNames
* @return Expectation
*/
public function shouldReceive(...$methodNames);
Expand Down
7 changes: 7 additions & 0 deletions tests/Mockery/MockeryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@ public function testAnotherMockTest(): void
self::assertSame('bar', $fooMock->doFoo());
}

public function testAlternativeMockTest(): void
{
$fooMock = \Mockery::mock(Foo::class);
$fooMock->shouldReceive(['doFoo' => 'bar']);
self::assertSame('bar', $fooMock->doFoo());
}

public function testMockFromProperty(): void
{
$this->requireFoo($this->fooMock);
Expand Down

0 comments on commit 6e8917e

Please sign in to comment.