private function ReportEvent(Event &$event) { $report = ''; $type = $event->GetType(); /* if (//EventType::USER_MSG() != $type || //EventType::PASS_MSG() != $type || EventType::FAIL_MSG() == $type) { $report .= 'Reason: ' . $event->GetReason() . PHP_EOL; } */ if (EventType::FAIL() == $type || EventType::ERROR() == $type) { $report .= "\tFailed Message: " . $event->GetMessage() . "\tSee detail" . PHP_EOL . "\tActual Type: " . $event->GetActualType() . "\tValue: " . $event->GetActualValue() . PHP_EOL . "\tComparison Type: " . $event->GetComparisonType() . "\tValue: " . $event->GetComparisonValue() . PHP_EOL . "\tFile: " . $event->GetFile() . " Line: " . $event->GetLine() . PHP_EOL; } else { if (EventType::EXCEPTION_THROWN() == $type) { $report .= "\tException: " . $event->GetReason() . PHP_EOL; $report .= "\t " . $event->GetMessage() . PHP_EOL; } } return $report; }
public function AssertOutputNotMatches($pattern, $message = '') { $actual = ob_get_contents(); $actual = ob_get_contents(); if ('string' != gettype($pattern)) { $this->testCaseResults->AddDetail(EventType::ERROR(), 'AssertOutputNotMatches: Expected need to be a string.', $message, $actual, $pattern); return; } $match = preg_match($pattern, $actual); $this->testCaseResults->AddDetail($match > 0 ? EventType::FAIL() : EventType::PASS(), 'AssertOutputNotMatches: ' . $match . ' matches found.', $message, $actual, $pattern); }