Skip to content

Commit 14d568b

Browse files
simPodondrejmirtes
authored andcommitted
Use Mockery\Expectation instead of CompositeExpectation
1 parent 2a30b98 commit 14d568b

File tree

3 files changed

+15
-2
lines changed

3 files changed

+15
-2
lines changed

src/Mockery/Type/ExpectationAfterStubDynamicReturnTypeExtension.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function isMethodSupported(MethodReflection $methodReflection): bool
3232

3333
public function getTypeFromMethodCall(MethodReflection $methodReflection, MethodCall $methodCall, Scope $scope): Type
3434
{
35-
return new ObjectType('Mockery\\CompositeExpectation');
35+
return new ObjectType('Mockery\\Expectation');
3636
}
3737

3838
}

src/Mockery/Type/ShouldReceiveDynamicReturnTypeExtension.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function isMethodSupported(MethodReflection $methodReflection): bool
2424

2525
public function getTypeFromMethodCall(MethodReflection $methodReflection, MethodCall $methodCall, Scope $scope): Type
2626
{
27-
return new ObjectType('Mockery\\CompositeExpectation');
27+
return new ObjectType('Mockery\\Expectation');
2828
}
2929

3030
}

tests/Mockery/MockeryBarTest.php

+13
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,17 @@ public function testFooIsCalled(): void
2121
self::assertSame('foo', $bar->doFoo());
2222
}
2323

24+
public function testExpectationMethodsAreCalled(): void
25+
{
26+
$bar = new Bar($this->fooMock);
27+
28+
$this->fooMock
29+
->shouldReceive('doFoo')
30+
->once()
31+
->times(1)
32+
->andReturn('foo');
33+
34+
self::assertSame('foo', $bar->doFoo());
35+
}
36+
2437
}

0 commit comments

Comments
 (0)