DEF STUDIO srl

Need help with Laravel and web development?

Hire one of our experts for your projects.

We build tailored products, websites and platforms — with care for UX, performance and maintainability.

Booking open for Q4 — limited slots

Collections Expectations

toBeCollection()

Assert that the value is an instance of \Illuminate\Support\Collection.

expect(collect[1,2,3])->toBeCollection();

toBeEloquentCollection()

Assert that the value is an instance of \Illuminate\Database\Eloquent\Collection.

expect(User::all())->toBeEloquentCollection();
Suggest a change
Last updated 22 August 2025