public function testExtractEating()
 {
     $expectedKeys = array("eatingProteinChoice", "eatingDrinksChoice", "eatingPotatoesChoice", "eatingBreakfastChoice", "eatingCheeseChoice", "eatingFruitAndVegChoice", "eatingDailySnackChoice", "eatingComplete", "eatingRag");
     $questionnaire = new Questionnaire(new Person());
     $export = EatingHelper::extractEating($questionnaire->getEating());
     foreach ($expectedKeys as $key) {
         $this->assertArrayHasKey($key, $export);
     }
 }
Ejemplo n.º 2
0
 public function __construct(Questionnaire $questionnaire, TranslatorInterface $translator)
 {
     $input = array();
     $input = array_merge($input, $this->extractIdentifiableInformation($questionnaire));
     $input = array_merge($input, RespondentHelper::extractRespondent($questionnaire->getPerson()));
     $input = array_merge($input, RespondentHelper::extractAddress($questionnaire->getPerson()->getAddress()));
     $input = array_merge($input, HowAreYouHelper::extractHowAreYouFeeling($questionnaire->getAboutYou()->getFeelings()));
     $input = array_merge($input, HowAreYouHelper::extractHindrances($questionnaire->getAboutYou()->getHindrances()));
     $input = array_merge($input, HowAreYouHelper::extractDependants($questionnaire->getAboutYou()->getDependants()));
     $input = array_merge($input, HowAreYouHelper::extractMotivations($questionnaire->getAboutYou()->getMotivations()));
     $input = array_merge($input, SmokingHelper::extractSmoking($questionnaire->getSmoking()));
     $input = array_merge($input, DrinkingHelper::extractDrinking($questionnaire->getDrinking()));
     $input = array_merge($input, MovingHelper::extractMoving($questionnaire->getMoving()));
     $input = array_merge($input, EatingHelper::extractEating($questionnaire->getEating()));
     $input = array_merge($input, ResultsNarrativeHelper::extractResultsNarrative($questionnaire, $translator));
     $input = array_merge($input, $this->extractRagScore($questionnaire));
     parent::__construct($input);
 }