public function testShouldBeAlertedReturnsTrueWithSettingAll() { $this->user->setAlertSetting(AlertSetting::ALL); foreach (ResultStatus::getAll() as $status) { $result = $this->getMockResult(); $result->setStatus($status)->setInfo("Stahp shut up and take my money scumbag stacy trollface."); $this->assertTrue($this->user->shouldBeAlerted($result)); } }
/** * Set result * * @param string $status * @return TestResult */ public function setStatus($status) { ResultStatus::isValid($status); $this->status = $status; return $this; }
/** * @param \DateTime $start */ private function getSummary(\DateTime $start) { $end = new \DateTime(); $runTime = $end->diff($start, true); $summary = ""; foreach (ResultStatus::getAll() as $status) { $summary .= $this->getColouredStatus($status, $this->results[$status]) . ", "; } $summary .= "in " . $runTime->i . " minutes and " . $runTime->s . " seconds"; return $summary; }