fix: offer the questionnaire after every placement, the bus part to escorts
This commit is contained in:
1 parent
9fedc5b5d3
commit
2f4f9800dd
30 files changed
+311
-77
No files matched your search
@@ -5,6 +5,7 @@ declare(strict_types=1);
|
||||
namespace App\Tests\Model\Questionnaire;
|
||||
|
||||
use App\Enum\ConditionOperator;
|
||||
use App\Enum\QuestionnaireFlag;
|
||||
use App\Enum\QuestionType;
|
||||
use App\Model\Questionnaire\Condition;
|
||||
use App\Model\Questionnaire\Definition;
|
||||
@@ -44,6 +45,19 @@ class DefinitionTest extends TestCase
|
||||
$this->assertFalse($definition->isVisible($details, ['damage' => 'no', 'claim' => 'expected']));
|
||||
}
|
||||
|
||||
public function testForFlagsDropsTheSectionsOfFlagsTheSubjectLacks(): void
|
||||
{
|
||||
$definition = new Definition('sample', 2, 'Beispiel', null, [
|
||||
new Section('everyone', null, [new Question('rating', 'Wie war es?', QuestionType::RATING)]),
|
||||
new Section('bus', null, [new Question('bus', 'Wie war der Bus?', QuestionType::RATING)], QuestionnaireFlag::BUS_ESCORT),
|
||||
]);
|
||||
|
||||
$this->assertSame(['rating'], array_keys($definition->forFlags([])->getQuestions()));
|
||||
$this->assertSame(['rating', 'bus'], array_keys($definition->forFlags([QuestionnaireFlag::BUS_ESCORT])->getQuestions()));
|
||||
// still the same questionnaire, so answers to it are answers to this definition
|
||||
$this->assertSame(2, $definition->forFlags([])->version);
|
||||
}
|
||||
|
||||
public function testWithoutHiddenAnswersDropsHiddenEmptyAndUnknownAnswers(): void
|
||||
{
|
||||
$answers = [
|
||||
|
||||
Reference in new issue
Block a user