Skip to content

Commit

Permalink
Use Mockery\Expectation instead of CompositeExpectation
Browse files Browse the repository at this point in the history
  • Loading branch information
simPod authored and ondrejmirtes committed Sep 9, 2018
1 parent 2a30b98 commit 14d568b
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function isMethodSupported(MethodReflection $methodReflection): bool

public function getTypeFromMethodCall(MethodReflection $methodReflection, MethodCall $methodCall, Scope $scope): Type
{
return new ObjectType('Mockery\\CompositeExpectation');
return new ObjectType('Mockery\\Expectation');
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function isMethodSupported(MethodReflection $methodReflection): bool

public function getTypeFromMethodCall(MethodReflection $methodReflection, MethodCall $methodCall, Scope $scope): Type
{
return new ObjectType('Mockery\\CompositeExpectation');
return new ObjectType('Mockery\\Expectation');
}

}
13 changes: 13 additions & 0 deletions tests/Mockery/MockeryBarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,17 @@ public function testFooIsCalled(): void
self::assertSame('foo', $bar->doFoo());
}

public function testExpectationMethodsAreCalled(): void
{
$bar = new Bar($this->fooMock);

$this->fooMock
->shouldReceive('doFoo')
->once()
->times(1)
->andReturn('foo');

self::assertSame('foo', $bar->doFoo());
}

}

0 comments on commit 14d568b

Please sign in to comment.