feat: offer the questionnaire for placements ended within a rolling window

This commit is contained in:
fromme committed 2026-11-10 09:23:23 +01:00
1 parent 9d0cdd7f52
commit 3c34cfa76a
8 files changed
+65 -55

No files matched your search

+12
View File
@@ -112,6 +112,18 @@ class QuestionnaireCatalogTest extends TestCase
$this->assertSame('Alte Frage', $catalog->get('sample', 1)->getQuestion('answer')->label);
}
public function testTheWindowStartsTheGivenDaysBeforeToday(): void
{
$this->assertEquals(new \DateTimeImmutable('today -2 days'), QuestionnaireCatalog::windowStart(2));
}
public function testANegativeWindowFailsLoudly(): void
{
$this->expectException(\InvalidArgumentException::class);
QuestionnaireCatalog::windowStart(-1);
}
public function testUnknownQuestionnaireIsRejected(): void
{
$this->expectException(\InvalidArgumentException::class);