Adds support for Higher Order Expectations in Higher Order Tests

This commit is contained in:
luke
2021-07-09 16:50:15 +01:00
parent e4e9cb09e4
commit 2a8de0565f
6 changed files with 67 additions and 18 deletions

View File

@ -67,6 +67,13 @@ it('can handle nested method calls', function () {
->books()->each->toBeArray();
});
it('works with higher order tests')
->expect(new HasMethods())
->newInstance()->newInstance()->name()->toEqual('Has Methods')->toBeString()
->newInstance()->name()->toEqual('Has Methods')->not->toBeArray
->name()->toEqual('Has Methods')
->books()->each->toBeArray;
class HasMethods
{
public function name()