/** * Displays and ending the current tests suite * * @return void */ function endtestcase() { $name = $GLOBALS["limonade"]["test_case_current"]; echo "## " . strtoupper($name) . "\n"; $desc = test_case_describe(); if (!is_null($desc)) { echo $desc . "\n"; } echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n"; test_case_execute_current(); if (!is_null($name)) { $test = $GLOBALS["limonade"]["test_cases"][$name]; // closing previous test echo "\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n"; echo $test['failures'] > 0 ? test_cli_format("|FAILED!|", "red") : test_cli_format("|PASSED|", "green"); echo " Test case '{$name}' finished: "; echo count(test_case_all_func()) . " tests, "; echo " {$test['failures']} failures for {$test['assertions']} assertions.\n"; echo "-----------------------------------------------------------\n"; } $GLOBALS["limonade"]["test_case_current"] = null; }
/** * Displays and ending the current tests suite. * * @return void */ function end_test_case() { $name = $GLOBALS['limonade']['test_case_current']; echo '## ' . strtoupper($name) . "\n"; $desc = test_case_describe(); if (!is_null($desc)) { echo $desc . "\n"; } echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n"; test_case_execute_current(); if (!is_null($name)) { $test = $GLOBALS['limonade']['test_cases'][$name]; // closing previous test echo "\n- - - - - - - - - - - - - - - - - - - - - - - - - - - - - -\n"; echo $test['failures'] > 0 ? test_cli_format('|FAILED!|', 'red') : test_cli_format('|PASSED|', 'green'); echo " Test case '{$name}' finished: "; echo count(test_case_all_func()) . ' tests, '; echo " {$test['failures']} failures for {$test['assertions']} assertions.\n"; echo "-----------------------------------------------------------\n"; } $GLOBALS['limonade']['test_case_current'] = null; }