Skip to content

Commit 326dfdd

Browse files
jfreixaondrejmirtes
authored andcommitted
add test to shouldAllowMockingProtectedMethods
1 parent d970cba commit 326dfdd

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

tests/Mockery/MockeryTest.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,15 @@ public function testMockWithMethods(): void
9595
self::assertSame('foo', $fooMock->doFoo());
9696
}
9797

98+
public function testMockShouldAllowMockingProtectedMethods(): void
99+
{
100+
$fooMock = \Mockery::mock(Foo::class)->shouldAllowMockingProtectedMethods();
101+
$this->requireFoo($fooMock);
102+
103+
$fooMock->shouldReceive('doFoo')->once()->andReturn('bar');
104+
self::assertSame('bar', $fooMock->doFoo());
105+
}
106+
98107
public function testMakePartial(): void
99108
{
100109
$fooMock = \Mockery::mock(Foo::class)->makePartial();

0 commit comments

Comments
 (0)