public function testICanGetAPositiveNarrativeAfterQuitting() { $questionnaire = new Questionnaire(new Person()); $questionnaire->getAboutYou()->getFeelings()->setEnergy(100)->setMood(20); $questionnaire->getSmoking()->setDoYouSmoke('quit')->setCompletedDate(new \DateTime()); $expected = array('smoking' => array('smoking_green_quit')); $this->assertEquals($expected, $this->instance->buildNarrative($questionnaire)->getMessages()); }
/** * @param Questionnaire $questionnaire */ protected function buildSmokingNarrative(Questionnaire $questionnaire) { if (SmokingSpecification::isSatisfiedBy($questionnaire)) { $snb = new SmokingNarrativeBuilder(); $narrative = $snb->buildNarrative($questionnaire); $this->narrative->merge($narrative); } }