/** * @param PHPUnit_Framework_TestResult $result * @access protected */ protected function printFooter(PHPUnit_Framework_TestResult $result) { if ($result->wasSuccessful() && $result->allCompletlyImplemented() && $result->noneSkipped()) { $this->write("\n[1;37;42m" . ($result = sprintf("OK (%d test%s, %d assertion%s)", count($result), count($result) == 1 ? '' : 's', $this->numAssertions, $this->numAssertions == 1 ? '' : 's')) . str_repeat(' ', 80 - strlen($result)) . "[0m\n"); } elseif ((!$result->allCompletlyImplemented() || !$result->noneSkipped()) && $result->wasSuccessful()) { $this->write("\n[1;37;43mOk, but incomplete or skipped tests! [0m\n" . sprintf("Tests: %d, Assertions: %d%s%s.\n", count($result), $this->numAssertions, $this->getCountString($result->notImplementedCount(), 'Incomplete'), $this->getCountString($result->skippedCount(), 'Skipped'))); } else { $this->write(sprintf("\n[1;37;41mFailures [m\n" . "Tests: %d, Assertions: %s%s%s%s.\n", count($result), $this->numAssertions, $this->getCountString($result->failureCount(), 'Failures'), $this->getCountString($result->errorCount(), 'Errors'), $this->getCountString($result->notImplementedCount(), 'Incomplete'), $this->getCountString($result->skippedCount(), 'Skipped'))); } }
/** * @param PHPUnit_Framework_TestResult $result */ protected function printFooter(PHPUnit_Framework_TestResult $result) { if ($result->wasSuccessful() && $result->allCompletlyImplemented() && $result->noneSkipped()) { if ($this->colors) { $this->write("[30;42m[2K"); } $this->write(sprintf("OK (%d test%s, %d assertion%s)\n", count($result), count($result) == 1 ? '' : 's', $this->numAssertions, $this->numAssertions == 1 ? '' : 's')); if ($this->colors) { $this->write("[0m[2K"); } } else { if ((!$result->allCompletlyImplemented() || !$result->noneSkipped()) && $result->wasSuccessful()) { if ($this->colors) { $this->write("[30;43m[2KOK, but incomplete or skipped tests!\n" . "[0m[30;43m[2K"); } else { $this->write("OK, but incomplete or skipped tests!\n"); } $this->write(sprintf("Tests: %d, Assertions: %d%s%s.\n", count($result), $this->numAssertions, $this->getCountString($result->notImplementedCount(), 'Incomplete'), $this->getCountString($result->skippedCount(), 'Skipped'))); if ($this->colors) { $this->write("[0m[2K"); } } else { $this->write("\n"); if ($this->colors) { $this->write("[37;41m[2KFAILURES!\n[0m[37;41m[2K"); } else { $this->write("FAILURES!\n"); } $this->write(sprintf("Tests: %d, Assertions: %s%s%s%s%s.\n", count($result), $this->numAssertions, $this->getCountString($result->failureCount(), 'Failures'), $this->getCountString($result->errorCount(), 'Errors'), $this->getCountString($result->notImplementedCount(), 'Incomplete'), $this->getCountString($result->skippedCount(), 'Skipped'))); if ($this->colors) { $this->write("[0m[2K"); } } } if (!$this->verbose && $result->deprecatedFeaturesCount() > 0) { $message = sprintf("Warning: Deprecated PHPUnit features are being used %s times!\n" . "Use --verbose for more information.\n", $result->deprecatedFeaturesCount()); if ($this->colors) { $message = "[37;41m[2K" . $message . "[0m"; } $this->write("\n" . $message); } }
/** * @param PHPUnit_Framework_TestResult $result */ protected function printFooter(PHPUnit_Framework_TestResult $result) { if ($result->wasSuccessful() && $result->allCompletlyImplemented() && $result->noneSkipped()) { if ($this->colors) { $this->write("[30;42m[2K"); } $this->write(sprintf("OK (%d test%s, %d assertion%s)\n", count($result), count($result) == 1 ? '' : 's', $this->numAssertions, $this->numAssertions == 1 ? '' : 's')); if ($this->colors) { $this->write("[0m[2K"); } } else { if ((!$result->allCompletlyImplemented() || !$result->noneSkipped()) && $result->wasSuccessful()) { if ($this->colors) { $this->write("[30;43m[2KOK, but incomplete or skipped tests!\n" . "[0m[30;43m[2K"); } else { $this->write("OK, but incomplete or skipped tests!\n"); } $this->write(sprintf("Tests: %d, Assertions: %d%s%s.\n", count($result), $this->numAssertions, $this->getCountString($result->notImplementedCount(), 'Incomplete'), $this->getCountString($result->skippedCount(), 'Skipped'))); if ($this->colors) { $this->write("[0m[2K"); } } else { $this->write("\n"); if ($this->colors) { $this->write("[37;41m[2KFAILURES!\n[0m[37;41m[2K"); } else { $this->write("FAILURES!\n"); } $this->write(sprintf("Tests: %d, Assertions: %s%s%s%s%s.\n", count($result), $this->numAssertions, $this->getCountString($result->failureCount(), 'Failures'), $this->getCountString($result->errorCount(), 'Errors'), $this->getCountString($result->notImplementedCount(), 'Incomplete'), $this->getCountString($result->skippedCount(), 'Skipped'))); if ($this->colors) { $this->write("[0m[2K"); } } } }
/** * @param PHPUnit_Framework_TestResult $result * @access protected */ protected function printFooter(PHPUnit_Framework_TestResult $result) { if ($result->wasSuccessful() && $result->allCompletlyImplemented() && $result->noneSkipped()) { $this->write(sprintf("\nOK (%d test%s)\n", count($result), count($result) == 1 ? '' : 's')); } else { if ((!$result->allCompletlyImplemented() || !$result->noneSkipped()) && $result->wasSuccessful()) { $this->write(sprintf("\nOK, but incomplete or skipped tests!\n" . "Tests: %d%s%s.\n", count($result), $this->getCountString($result->notImplementedCount(), 'Incomplete'), $this->getCountString($result->skippedCount(), 'Skipped'))); } else { $this->write(sprintf("\nFAILURES!\n" . "Tests: %d%s%s%s%s.\n", count($result), $this->getCountString($result->failureCount(), 'Failures'), $this->getCountString($result->errorCount(), 'Errors'), $this->getCountString($result->notImplementedCount(), 'Incomplete'), $this->getCountString($result->skippedCount(), 'Skipped'))); } } }
/** * @param PHPUnit_Framework_TestResult $result * @access protected */ protected function printFooter(PHPUnit_Framework_TestResult $result) { if ($result->wasSuccessful() && $result->allCompletlyImplemented() && $result->noneSkipped()) { $this->write(sprintf("<tfoot><tr style='background-color: green'><td colspan='5'>OK (%d test%s)</td>/<tr></tfoot>", count($result), count($result) == 1 ? '' : 's')); } else { if ((!$result->allCompletlyImplemented() || !$result->noneSkipped()) && $result->wasSuccessful()) { $this->write(sprintf("<tfoot><tr style='background-color: yellow'><td colspan='5'>OK, but incomplete or skipped tests! Tests: %d%s%s.</td>/<tr></tfoot>", count($result), $this->getCountString($result->notImplementedCount(), 'Incomplete'), $this->getCountString($result->skippedCount(), 'Skipped'))); } else { $this->write(sprintf("<tfoot><tr style='background-color: red'><td colspan='5'>FAILURES ! Tests: %d%s%s.</td>/<tr></tfoot>", count($result), $this->getCountString($result->failureCount(), 'Failures'), $this->getCountString($result->errorCount(), 'Errors'), $this->getCountString($result->notImplementedCount(), 'Incomplete'), $this->getCountString($result->skippedCount(), 'Skipped'))); } } $this->write('</table>'); }