toBeInstanceOf(Faq::class) ->and($faq->id)->toBeInt() ->and($faq->question)->toBe('Comment contacter le support ?') ->and($faq->answer)->toBe('Via notre formulaire de contact en ligne.'); $fresh = Faq::query()->find($faq->id); expect($fresh)->not->toBeNull() ->and($fresh?->question)->toBe('Comment contacter le support ?') ->and($fresh?->answer)->toBe('Via notre formulaire de contact en ligne.'); }); it('throws when an invalid input is passed', function (): void { // GIVEN $action = new CreateFaq(); $invalidInput = new class () implements ActionInput { }; // WHEN expect( /** @phpstan-ignore argument.type */ fn () => $action($invalidInput) ) // THEN ->toThrow(\InvalidArgumentException::class); }); });