From 5aee3dca91c1ef2f100d06e543e8647acacd7344 Mon Sep 17 00:00:00 2001 From: Ben Batschelet Date: Fri, 19 Jul 2019 15:57:30 -0500 Subject: [PATCH] Add test for method declaration --- tests/Mockery/MockeryTest.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tests/Mockery/MockeryTest.php b/tests/Mockery/MockeryTest.php index 7b22237..5dfe9bd 100644 --- a/tests/Mockery/MockeryTest.php +++ b/tests/Mockery/MockeryTest.php @@ -86,6 +86,15 @@ public function testMockWithInterfaceAndConstructorArgs(): void self::assertSame('bar', $fooMock->doFoo()); } + public function testMockWithMethods(): void + { + $fooMock = \Mockery::mock(Foo::class . '[doFoo]'); + $this->requireFoo($fooMock); + + $fooMock->allows()->doFoo()->andReturns('foo'); + self::assertSame('foo', $fooMock->doFoo()); + } + private function requireFoo(Foo $foo): void { }