Skip to content

Commit 6e8917e

Browse files
wimskiondrejmirtes
authored andcommitted
Fix type hint of $methodNames argument in MockInterface.stub
1 parent a3a1b7e commit 6e8917e

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

stubs/MockInterface.stub

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface MockInterface
66
{
77

88
/**
9-
* @param string[] ...$methodNames
9+
* @param string|array<string, mixed> ...$methodNames
1010
* @return Expectation
1111
*/
1212
public function shouldReceive(...$methodNames);
@@ -22,7 +22,7 @@ interface LegacyMockInterface
2222
{
2323

2424
/**
25-
* @param string[] ...$methodNames
25+
* @param string|array<string, mixed> ...$methodNames
2626
* @return Expectation
2727
*/
2828
public function shouldReceive(...$methodNames);

tests/Mockery/MockeryTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ public function testAnotherMockTest(): void
3838
self::assertSame('bar', $fooMock->doFoo());
3939
}
4040

41+
public function testAlternativeMockTest(): void
42+
{
43+
$fooMock = \Mockery::mock(Foo::class);
44+
$fooMock->shouldReceive(['doFoo' => 'bar']);
45+
self::assertSame('bar', $fooMock->doFoo());
46+
}
47+
4148
public function testMockFromProperty(): void
4249
{
4350
$this->requireFoo($this->fooMock);

0 commit comments

Comments
 (0)