diff --git a/tests/Features/Expect/sequence.php b/tests/Features/Expect/sequence.php index b15385e5..e145f743 100644 --- a/tests/Features/Expect/sequence.php +++ b/tests/Features/Expect/sequence.php @@ -9,9 +9,15 @@ test('an exception is thrown if the the type is not iterable', function () { test('allows for sequences of checks to be run on iterable data', function () { expect([1, 2, 3]) ->sequence( - function ($expectation) { $expectation->toBeInt()->toEqual(1); }, - function ($expectation) { $expectation->toBeInt()->toEqual(2); }, - function ($expectation) { $expectation->toBeInt()->toEqual(3); }, + function ($expectation) { + $expectation->toBeInt()->toEqual(1); + }, + function ($expectation) { + $expectation->toBeInt()->toEqual(2); + }, + function ($expectation) { + $expectation->toBeInt()->toEqual(3); + }, ); expect(static::getCount())->toBe(6); @@ -20,9 +26,15 @@ test('allows for sequences of checks to be run on iterable data', function () { test('loops back to the start if it runs out of sequence items', function () { expect([1, 2, 3, 1, 2, 3, 1, 2]) ->sequence( - function ($expectation) { $expectation->toBeInt()->toEqual(1); }, - function ($expectation) { $expectation->toBeInt()->toEqual(2); }, - function ($expectation) { $expectation->toBeInt()->toEqual(3); }, + function ($expectation) { + $expectation->toBeInt()->toEqual(1); + }, + function ($expectation) { + $expectation->toBeInt()->toEqual(2); + }, + function ($expectation) { + $expectation->toBeInt()->toEqual(3); + }, ); expect(static::getCount())->toBe(16); @@ -31,19 +43,29 @@ test('loops back to the start if it runs out of sequence items', function () { test('fails if the number of iterable items is greater than the number of expectations', function () { expect([1, 2]) ->sequence( - function ($expectation) { $expectation->toBeInt()->toEqual(1); }, - function ($expectation) { $expectation->toBeInt()->toEqual(2); }, - function ($expectation) { $expectation->toBeInt()->toEqual(3); }, + function ($expectation) { + $expectation->toBeInt()->toEqual(1); + }, + function ($expectation) { + $expectation->toBeInt()->toEqual(2); + }, + function ($expectation) { + $expectation->toBeInt()->toEqual(3); + }, ); })->throws(ExpectationFailedException::class); test('it works with associative arrays', function () { expect(['foo' => 'bar', 'baz' => 'boom']) ->sequence( - function ($expectation, $key) { $expectation->toEqual('bar'); - $key->toEqual('foo'); }, - function ($expectation, $key) { $expectation->toEqual('boom'); - $key->toEqual('baz'); }, + function ($expectation, $key) { + $expectation->toEqual('bar'); + $key->toEqual('foo'); + }, + function ($expectation, $key) { + $expectation->toEqual('boom'); + $key->toEqual('baz'); + }, ); }); @@ -56,7 +78,9 @@ test('it can be passed non-callable values', function () { test('it can be passed a mixture of value types', function () { expect(['foo', 'bar', 'baz'])->sequence( 'foo', - function ($expectation) { $expectation->toEqual('bar')->toBeString(); }, + function ($expectation) { + $expectation->toEqual('bar')->toBeString(); + }, 'baz' );