Uses Collision ^7.0

This commit is contained in:
Nuno Maduro
2022-09-15 01:07:15 +01:00
parent eab944023c
commit 3ff95faaaa
47 changed files with 646 additions and 308 deletions

View File

@ -40,8 +40,12 @@ it('works inside of each', function () {
it('works with sequence', function () {
expect(new HasMethods())
->books()->sequence(
function ($book) { $book->title->toEqual('Foo')->cost->toEqual(20); },
function ($book) { $book->title->toEqual('Bar')->cost->toEqual(30); },
function ($book) {
$book->title->toEqual('Foo')->cost->toEqual(20);
},
function ($book) {
$book->title->toEqual('Bar')->cost->toEqual(30);
},
);
});
@ -54,8 +58,12 @@ it('can compose complex expectations', function () {
->attributes()->toBeArray()
->books()->toBeArray->each->not->toBeEmpty
->books()->sequence(
function ($book) { $book->title->toEqual('Foo')->cost->toEqual(20); },
function ($book) { $book->title->toEqual('Bar')->cost->toEqual(30); },
function ($book) {
$book->title->toEqual('Foo')->cost->toEqual(20);
},
function ($book) {
$book->title->toEqual('Bar')->cost->toEqual(30);
},
);
});