ldc-cocotte/tests/Unit/App/Actions/Common/ChangeModelOrderInputTest.php
Jérémy Munsch d0efb0f527
refactor: update namespaces for actions and queries
Refactored the codebase to change the namespaces of various actions and queries from `App\Actions` to `App\Cqs\Actions` and `App\Queries` to `App\Cqs\Queries`. This restructuring improves organization and clarity in the codebase.
2026-11-10 15:13:26 +01:00

31 lines
869 B
PHP

<?php
declare(strict_types=1);
use App\Cqs\Actions\Common\ChangeModelOrderInput;
use App\Interfaces\ModelWithOrder;
use Illuminate\Database\Eloquent\Model;
describe('ChangeModelOrderInput', function (): void {
it('can be instantiated with a model implementing ModelWithOrder and a SortDirection', function (): void {
// GIVEN
$mock = new class () extends Model implements ModelWithOrder
{
public function getOrder(): int
{
return 1;
}
public function setOrder(int $order): void
{
}
};
// WHEN
$input = new ChangeModelOrderInput(model: $mock, direction: \SortDirection::Ascending);
// THEN
expect($input->model)->toBe($mock)
->and($input->direction)->toBe(\SortDirection::Ascending);
});
});