Skip to content

Commit 5aee3dc

Browse files
bbatscheondrejmirtes
authored andcommitted
Add test for method declaration
1 parent a013b23 commit 5aee3dc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/Mockery/MockeryTest.php

+9
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,15 @@ public function testMockWithInterfaceAndConstructorArgs(): void
8686
self::assertSame('bar', $fooMock->doFoo());
8787
}
8888

89+
public function testMockWithMethods(): void
90+
{
91+
$fooMock = \Mockery::mock(Foo::class . '[doFoo]');
92+
$this->requireFoo($fooMock);
93+
94+
$fooMock->allows()->doFoo()->andReturns('foo');
95+
self::assertSame('foo', $fooMock->doFoo());
96+
}
97+
8998
private function requireFoo(Foo $foo): void
9099
{
91100
}

0 commit comments

Comments
 (0)