Skip to content

Commit

Permalink
Improving the help screen in the testsuite shell
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Jul 14, 2010
1 parent 01cfe32 commit 7f7de13
Showing 1 changed file with 71 additions and 31 deletions.
102 changes: 71 additions & 31 deletions cake/console/libs/testsuite.php
Expand Up @@ -180,36 +180,76 @@ public function available() {
* @return void
*/
public function help() {
$help = <<<TEXT
Usage:
-----
cake testsuite <category> <file> [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 <category> <file> [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 <category> [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 <file> Log test execution in JUnit XML format to file.");
$this->out("--log-json <file> Log test execution in JSON format.");

$this->out("--coverage-html <dir> Generate code coverage report in HTML format.");
$this->out("--coverage-clover <file> Write code coverage data in Clover XML format.");
$this->out("--coverage-source <dir> Write code coverage / source data in XML format.");

$this->out("--story-html <file> Write Story/BDD results in HTML format to file.");
$this->out("--story-text <file> Write Story/BDD results in Text format to file.");

$this->out("--testdox-html <file> Write agile documentation in HTML format to file.");
$this->out("--testdox-text <file> Write agile documentation in Text format to file.");

$this->out("--filter <pattern> 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 <pattern> Filter which tests to run.");
$this->out("--loader <loader> TestSuiteLoader implementation to use.");
$this->out("--repeat <times> 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 <file> A \"bootstrap\" PHP file that is run before the tests.");
$this->out("--configuration <file> Read configuration from XML file.");
$this->out("--no-configuration Ignore default configuration file (phpunit.xml).");
$this->out("--include-path <path(s)> Prepend PHP's include_path with given path(s).");

$this->out("-d key[=value] Sets a php.ini value. \n");
}

}

0 comments on commit 7f7de13

Please sign in to comment.