question = 'Second question?'; $faq2->answer = 'Second answer.'; $faq2->order = 2; $faq2->save(); $faq1 = new Faq(); $faq1->question = 'First question?'; $faq1->answer = 'First answer.'; $faq1->order = 1; $faq1->save(); $query = app(GetFaqsQuery::class); // WHEN $faqs = $query(new QueryInputEmpty()); // THEN expect($faqs)->toBeInstanceOf(Collection::class) ->and($faqs)->toHaveCount(2) ->and($faqs->first())->toBeInstanceOf(FaqDto::class) ->and($faqs->first()->question)->toBe('First question?') ->and($faqs->last()->question)->toBe('Second question?'); }); });