public function testIHaveAScoreOfEight() { $expected = array('value' => 1, 'rag' => "amber", 'normalized_score' => 5); $this->assertEquals($expected, $this->questionnaire->getRagScore()); }
public function testIHaveAScoreOfThree() { $expected = array('value' => 0, 'rag' => "red", 'normalized_score' => 3); $this->assertEquals($expected, $this->questionnaire->getRagScore()); }
/** * @inheritDoc */ public static function isSatisfiedBy(Questionnaire $questionnaire) { return $questionnaire->getRagScore()['normalized_score'] <= QuestionnaireScore::RED_CUTOFF; }
/** * @param Questionnaire $questionnaire * @return array */ protected function extractRagScore(Questionnaire $questionnaire) { $ragScore = $questionnaire->getRagScore(); return array('ragRating' => $ragScore['rag'], 'questionnaireScore' => $ragScore['value'], 'normalizedQuestionnaireScore' => !empty($ragScore['normalized_score']) ? $ragScore['normalized_score'] : null); }
/** * @param Questionnaire $questionnaire */ protected function addGlobalSubstitutions(Questionnaire $questionnaire) { $this->narrative->addSubstitution('{{FINAL_SCORE}}', $questionnaire->getRagScore()['normalized_score']); }
public function testIHaveAScoreOfOne() { $expected = array('value' => 2, 'rag' => "green", 'normalized_score' => 10); $this->assertEquals($expected, $this->questionnaire->getRagScore()); }
public function testGetRagScore() { $expected = array('value' => 0, 'rag' => ''); $this->assertEquals($expected, $this->instance->getRagScore()); }