src/Application/ConsoleApplication.php
/**
     * Prints a report from the result of the tests.
     *
     * @param TestSuiteResultInterface $testResults The test results.
     */
Prints a report from the result of the tests.
@param TestSuiteResultInterface $testResults The test results.
Prints a report from the result of the tests . @param TestSuiteResultInterface $testResults The test results .
private function printReport(TestSuiteResultInterface $testResults): void
    {
        if ($testResults->isSuccess()) {
            $count = $testResults->getSuccessfulTestsCount();
            self::success($count . ' test' . ($count > 1 ? 's' : '') . ' completed successfully.');
            return;
        }
        foreach ($testResults->getFailedTestCaseResults() as $failedTestCaseResult) {
            $failedTestCase = $failedTestCaseResult->getTestCase();
            $failedAssertResult = $failedTestCaseResult->getFailedAssertResult();
            $failedAssert = $failedAssertResult->getAssert();
            echo $failedAssert->getLocation() . ': Test failed: ' . $failedTestCase->getUrl() . ': ' . $failedAssertResult->getError() . '.' . PHP_EOL;
        }
        $count = $testResults->getFailedTestsCount();
        self::fail($count . ' test' . ($count > 1 ? 's' : '') . ' failed.');
    }
private function printReport ( TestSuiteResultInterface $ testResults ) : void { if ( $ testResults -> isSuccess ( ) ) { $ count = $ testResults -> getSuccessfulTestsCount ( ) ; self :: success ( $ count . ' test' . ( $ count > 1 ? 's' : '' ) . ' completed successfully.' ) ; return ; } foreach ( $ testResults -> getFailedTestCaseResults ( ) as $ failedTestCaseResult ) { $ failedTestCase = $ failedTestCaseResult -> getTestCase ( ) ; $ failedAssertResult = $ failedTestCaseResult -> getFailedAssertResult ( ) ; $ failedAssert = $ failedAssertResult -> getAssert ( ) ; echo $ failedAssert -> getLocation ( ) . ': Test failed: ' . $ failedTestCase -> getUrl ( ) . ': ' . $ failedAssertResult -> getError ( ) . '.' . PHP_EOL ; } $ count = $ testResults -> getFailedTestsCount ( ) ; self :: fail ( $ count . ' test' . ( $ count > 1 ? 's' : '' ) . ' failed.' ) ; }
Prints a report from the result of the tests.
Prints a report from the result of the tests .