ldc-boutique-cnc-sable/tests/Unit/App/Actions/Common/ToggleModelStarInputTest.php

29 lines
708 B
PHP

<?php
declare(strict_types=1);
use App\Actions\Common\ToggleModelStarInput;
use App\Interfaces\ModelWithStar;
use Illuminate\Database\Eloquent\Model;
describe('ToggleModelStarInput', function (): void {
it('can be instantiated with a model implementing ModelWithStar', function (): void {
// GIVEN
$mock = new class () extends Model implements ModelWithStar
{
public function setStar(bool $value): void
{
}
public function toggleStar(): void
{
}
};
// WHEN
$input = new ToggleModelStarInput(model: $mock);
// THEN
expect($input->model)->toBe($mock);
});
});