From 7f7de13905ba40f1aeda425cbe26848b0d89e28a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Lorenzo=20Rodr=C3=ADguez=20Urdaneta?= Date: Tue, 13 Jul 2010 20:20:19 -0430 Subject: [PATCH] Improving the help screen in the testsuite shell --- cake/console/libs/testsuite.php | 102 ++++++++++++++++++++++---------- 1 file changed, 71 insertions(+), 31 deletions(-) diff --git a/cake/console/libs/testsuite.php b/cake/console/libs/testsuite.php index 5d0070ba183..2a5b93371e3 100644 --- a/cake/console/libs/testsuite.php +++ b/cake/console/libs/testsuite.php @@ -180,36 +180,76 @@ public function available() { * @return void */ public function help() { - $help = << [params] - - category - "app", "core" or name of a plugin - - file - file name with folder prefix and without the test.php suffix. - -Params: -------- - -filter - The -filter option allows you supply a pattern that is used to match - test method names. This can be a regular expression. - - -coverage - Enable code coverage for this run. - -Examples: ---------- - cake testsuite app behaviors/debuggable; - cake testsuite app models/my_model; - cake testsuite app controllers/my_controller - - cake testsuite core libs/file - cake testsuite core libs/router - cake testsuite core libs/set - - cake testsuite bugs models/bug - // for the plugin 'bugs' and its test case 'models/bug' - -TEXT; - $this->out($help); + $this->out('CakePHP Testsuite:'); + $this->hr(); + + $this->out('The CakPHP Testsuite allows you to run test cases from the comman line'); + $this->out('If run with no command line arguments, a list of available core test cases will be shown'); + $this->hr(); + + $this->out("Usage: cake testuite [params]"); + $this->out("\t- category: app, core or name of a plugin"); + $this->out("\t- file: file name with folder prefix and without the test.php suffix"); + $this->hr(); + + $this->out("Usage: cake testuite available [params]"); + $this->out("\t Shows a list of available testcases for the specified category"); + $this->out("\t Params list will be used for running the selected test case"); + $this->hr(); + + $this->out('Examples:'); + $this->out('cake testsuite app models/my_model'); + $this->out("cake testsuite app controllers/my_controller \n"); + $this->out('cake testsuite core libs/file'); + $this->out("cake testsuite core libs/set \n"); + $this->out('cake testsuite bugs models/bug -- for the plugin bugs and its test case models/bug'); + $this->hr(); + + $this->out('Params:'); + $this->out("--log-junit Log test execution in JUnit XML format to file."); + $this->out("--log-json Log test execution in JSON format."); + + $this->out("--coverage-html Generate code coverage report in HTML format."); + $this->out("--coverage-clover Write code coverage data in Clover XML format."); + $this->out("--coverage-source Write code coverage / source data in XML format."); + + $this->out("--story-html Write Story/BDD results in HTML format to file."); + $this->out("--story-text Write Story/BDD results in Text format to file."); + + $this->out("--testdox-html Write agile documentation in HTML format to file."); + $this->out("--testdox-text Write agile documentation in Text format to file."); + + $this->out("--filter Filter which tests to run."); + $this->out("--group ... Only runs tests from the specified group(s)."); + $this->out("--exclude-group ... Exclude tests from the specified group(s)."); + $this->out("--filter Filter which tests to run."); + $this->out("--loader TestSuiteLoader implementation to use."); + $this->out("--repeat Runs the test(s) repeatedly."); + + $this->out("--story Report test execution progress in Story/BDD format."); + $this->out("--tap Report test execution progress in TAP format."); + $this->out("--testdox Report test execution progress in TestDox format."); + + $this->out("--colors Use colors in output."); + $this->out("--stderr Write to STDERR instead of STDOUT."); + $this->out("--stop-on-failure Stop execution upon first error or failure."); + $this->out("--verbose Output more verbose information."); + $this->out("--wait Waits for a keystroke after each test."); + + $this->out("--skeleton-class Generate Unit class for UnitTest in UnitTest.php."); + $this->out("--skeleton-test Generate UnitTest class for Unit in Unit.php."); + + $this->out("--process-isolation Run each test in a separate PHP process."); + $this->out("--no-globals-backup Do not backup and restore \$GLOBALS for each test."); + $this->out("--static-backup Backup and restore static attributes for each test."); + $this->out("--syntax-check Try to check source files for syntax errors."); + + $this->out("--bootstrap A \"bootstrap\" PHP file that is run before the tests."); + $this->out("--configuration Read configuration from XML file."); + $this->out("--no-configuration Ignore default configuration file (phpunit.xml)."); + $this->out("--include-path Prepend PHP's include_path with given path(s)."); + + $this->out("-d key[=value] Sets a php.ini value. \n"); } + }