test for date end being before date start

This commit is contained in:
Yisroel Baum 2026-04-23 20:50:26 +03:00
parent a752ff9ba5
commit 858f2e075f
Signed by: yisroelbaum
GPG key ID: 0FA60884F75520A9
2 changed files with 21 additions and 0 deletions

View file

@ -216,4 +216,18 @@ class CreatePlanTest extends TestCase
dateEnd: null,
));
}
public function test_throws_if_date_end_is_before_date_start(): void
{
$this->expectException(BadRequestException::class);
$this->expectExceptionMessage('date end cannot be before date start');
$this->useCase->execute(new CreatePlanRequest(
userId: 0,
name: 'test',
textId: 0,
dateStart: '2025-01-02',
dateEnd: '2025-01-01',
));
}
}