private function ReportEvent(Event &$event) { $report = ' <type>' . htmlentities($event->GetTypeAsString()) . "</type>\n"; $report .= ' <time>' . htmlentities($event->GetTime()) . "</time>\n"; $type = $event->GetType(); if (EventType::START_SETUP() == $type || EventType::END_SETUP() == $type || EventType::START_RUN() == $type || EventType::END_RUN() == $type || EventType::START_TEAR_DOWN() == $type || EventType::END_TEAR_DOWN() == $type) { return $report; } if (EventType::USER_MSG() != $type || EventType::PASS_MSG() != $type || EventType::FAIL_MSG() != $type) { $report .= ' <reason>' . htmlentities($event->GetReason()) . "</reason>\n"; } if (EventType::SYS_MSG() != $type) { $report .= ' <message>' . htmlentities($event->GetMessage()) . "</message>\n"; } if (EventType::SYS_MSG() != $type && EventType::USER_MSG() != $type && EventType::FAIL_MSG() != $type && EventType::PASS_MSG() != $type && EventType::EXCEPTION_THROWN() != $type) { $report .= " <actual>\n" . ' <type>' . htmlentities($event->GetActualType()) . "</type>\n" . ' <value>' . htmlentities($event->GetActualValue()) . "</value></actual>\n"; $report .= " <comparison>\n" . ' <type>' . htmlentities($event->GetComparisonType()) . "</type>\n" . ' <value>' . htmlentities($event->GetComparisonValue()) . "</value></comparison>\n"; } if (EventType::SYS_MSG() != $type) { $report .= ' <file>' . htmlentities($event->GetFile()) . "</file>\n"; $report .= ' <line>' . htmlentities($event->GetLine()) . "</line>\n"; } return $report; }
public function Fail($message) { $this->testCaseResults->AddMessage($message, EventType::FAIL_MSG()); }