diff --git a/tests/Features/Expect/HigherOrder/methodsAndProperties.php b/tests/Features/Expect/HigherOrder/methodsAndProperties.php index b98c9f16..c9ef45aa 100644 --- a/tests/Features/Expect/HigherOrder/methodsAndProperties.php +++ b/tests/Features/Expect/HigherOrder/methodsAndProperties.php @@ -48,6 +48,15 @@ it('can start a new higher order expectation using the and syntax in higher orde ->toBeArray() ->foo->toEqual('bar'); +it('can start a new higher order expectation using the and syntax without nesting expectations', function () { + expect(new HasMethodsAndProperties()) + ->toBeInstanceOf(HasMethodsAndProperties::class) + ->meta + ->sequence( + function ($value, $key) { $value->toBeArray()->and($key)->toBe('foo'); }, + ); +}); + class HasMethodsAndProperties { public $name = 'Has Methods and Properties';