Contenu promo

', link: 'https://example.com/promo', linkLabel: 'En profiter', linkNewTab: true, connected: false, period: $period, ); // WHEN $slide = $action($input); // THEN expect($slide)->toBeInstanceOf(Slide::class) ->and($slide->id)->toBeGreaterThan(0) ->and($slide->title)->toBe('Nouvelle Bannière') ->and($slide->text)->toBe('

Contenu promo

') ->and($slide->link)->toBe('https://example.com/promo') ->and($slide->link_label)->toBe('En profiter') ->and($slide->link_new_tab)->toBeTrue() ->and($slide->connected)->toBeFalse(); $fresh = Slide::query()->find($slide->id); expect($fresh)->not->toBeNull() ->and($fresh?->title)->toBe('Nouvelle Bannière'); }); it('throws when an invalid input is passed', function (): void { // GIVEN $action = new CreateSlide(); $invalidInput = new class () implements ActionInput { }; // WHEN expect( /** @phpstan-ignore argument.type */ fn () => $action($invalidInput) ) // THEN ->toThrow(\InvalidArgumentException::class); }); });