Unit Tests

'; echo '

Codebase: ' . $testRunner->getRootPath() . '

'; echo '

Test Suite: ' . $pattern . '

'; } /** * Prints the footer after the test output. * * @param xTestRunner $testRunner Test runner. * @return void */ public function suiteFooter(xTestRunner $testRunner) { echo ''; } /** * Creates code coverage report. * * @param \PHP_CodeCoverage $coverage Code coverage collector. * @return void */ public function createCodeCoverageReport(\PHP_CodeCoverage $coverage = null) { if (!isset($coverage)) { echo '

Code coverage analysis unavailable

To enable code coverage, the xdebug php module must be installed and enabled.

'; return; } $writer = new \PHP_CodeCoverage_Report_HTML; $writer->process($coverage, FULL_PATH . '/test/runtime/coverage'); echo 'Code coverage report'; } /** * Prints test header. * * @param xTest $test Test. * @return void */ public function testHeader(xTest $test) { $class = get_class($test); echo '

Test Class: ' . htmlspecialchars($class) . '

'; echo ''; } /** * Test case result. * * @param \ReflectionMethod $testCaseMethod Test case method. * @param string $resultColor Result color. * @param string $resultMessage Result message. * @return void */ public function testCaseResult(\ReflectionMethod $testCaseMethod, $resultColor, $resultMessage) { echo ''; } /** * Prints test footer. * * @param xTest $test Test. * @param integer $total Total test case count. * @param integer $passed Passed test case count. * @return void */ public function testFooter(xTest $test, $total, $passed) { echo '
TestResult
(' . $testCaseMethod->getStartLine() . ') '; echo '' . $this->getTestCaseName($testCaseMethod, true) . ''; echo '
' . htmlspecialchars($resultMessage) . '
' . $total . ' Tests'; if ($passed == $total) { echo 'All Tests Passed' . PHP_EOL; } else { echo ($total - $passed) . ' Tests Failed' . PHP_EOL; } echo '
'; if ($passed == $total) { $class = get_class($test); echo '

» All Tests Passed

'; } } }