29 lines
724 B
PHP
29 lines
724 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Actions\Common\ToggleModelStatusInput;
|
|
use App\Interfaces\ModelWithStatus;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
describe('ToggleModelStatusInput', function (): void {
|
|
it('can be instantiated with a model implementing ModelWithStatus', function (): void {
|
|
// GIVEN
|
|
$mock = new class () extends Model implements ModelWithStatus
|
|
{
|
|
public function setStatus(bool $value): void
|
|
{
|
|
}
|
|
|
|
public function toggleStatus(): void
|
|
{
|
|
}
|
|
};
|
|
|
|
// WHEN
|
|
$input = new ToggleModelStatusInput(model: $mock);
|
|
|
|
// THEN
|
|
expect($input->model)->toBe($mock);
|
|
});
|
|
});
|