{"action":"created","issue":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/7432","labels_url":"https://api.github.com/repos/cakephp/cakephp/issues/7432/labels{/name}","comments_url":"https://api.github.com/repos/cakephp/cakephp/issues/7432/comments","events_url":"https://api.github.com/repos/cakephp/cakephp/issues/7432/events","html_url":"https://github.com/cakephp/cakephp/issues/7432","id":107606714,"number":7432,"title":"2.x: TestShell offers --quiet, but mis-processes it.","user":{"login":"beporter","id":637270,"avatar_url":"https://avatars.githubusercontent.com/u/637270?v=3","gravatar_id":"","url":"https://api.github.com/users/beporter","html_url":"https://github.com/beporter","followers_url":"https://api.github.com/users/beporter/followers","following_url":"https://api.github.com/users/beporter/following{/other_user}","gists_url":"https://api.github.com/users/beporter/gists{/gist_id}","starred_url":"https://api.github.com/users/beporter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beporter/subscriptions","organizations_url":"https://api.github.com/users/beporter/orgs","repos_url":"https://api.github.com/users/beporter/repos","events_url":"https://api.github.com/users/beporter/events{/privacy}","received_events_url":"https://api.github.com/users/beporter/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/cakephp/cakephp/milestones/58","html_url":"https://github.com/cakephp/cakephp/milestones/2.7.4","labels_url":"https://api.github.com/repos/cakephp/cakephp/milestones/58/labels","id":1268551,"number":58,"title":"2.7.4","description":"Bugfixes and minor optimizations for 2.7.x.","creator":{"login":"markstory","id":24086,"avatar_url":"https://avatars.githubusercontent.com/u/24086?v=3","gravatar_id":"","url":"https://api.github.com/users/markstory","html_url":"https://github.com/markstory","followers_url":"https://api.github.com/users/markstory/followers","following_url":"https://api.github.com/users/markstory/following{/other_user}","gists_url":"https://api.github.com/users/markstory/gists{/gist_id}","starred_url":"https://api.github.com/users/markstory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markstory/subscriptions","organizations_url":"https://api.github.com/users/markstory/orgs","repos_url":"https://api.github.com/users/markstory/repos","events_url":"https://api.github.com/users/markstory/events{/privacy}","received_events_url":"https://api.github.com/users/markstory/received_events","type":"User","site_admin":false},"open_issues":16,"closed_issues":19,"state":"open","created_at":"2015-08-24T02:25:19Z","updated_at":"2015-09-22T01:23:53Z","due_on":"2015-09-20T04:00:00Z","closed_at":null},"comments":1,"created_at":"2015-09-21T21:54:56Z","updated_at":"2015-09-22T01:26:06Z","closed_at":null,"body":"Sample shell execution:\r\n\r\n```\r\n$ Console/cake test -h\r\n\r\nWelcome to CakePHP v2.7.1 Console\r\n---------------------------------------------------------------\r\nApp : www\r\nPath: /var/www/\r\n---------------------------------------------------------------\r\nThe CakePHP Testsuite allows you to run test cases from the command line\r\n\r\nUsage:\r\ncake test [options] [<category>] [<file>]\r\n\r\nOptions:\r\n\r\n--help, -h                Display this help.\r\n--verbose, -v             Enable verbose output.\r\n--quiet, -q               Enable quiet output.\r\n--log-junit               <file> Log test execution in JUnit XML format\r\n                          to file.\r\n--log-json                <file> Log test execution in JSON format to\r\n                          file.\r\n--log-tap                 <file> Log test execution in TAP format to\r\n                          file.\r\n--log-dbus                Log test execution to DBUS.\r\n--coverage-html           <dir> Generate code coverage report in HTML\r\n                          format.\r\n--coverage-clover         <file> Write code coverage data in Clover XML\r\n                          format.\r\n--testdox-html            <file> Write agile documentation in HTML\r\n                          format to file.\r\n--testdox-text            <file> Write agile documentation in Text\r\n                          format to file.\r\n--filter                  <pattern> Filter which tests to run.\r\n--group                   <name> Only runs tests from the specified\r\n                          group(s).\r\n--exclude-group           <name> Exclude tests from the specified\r\n                          group(s).\r\n--list-groups             List available test groups.\r\n--loader                  TestSuiteLoader implementation to use.\r\n--repeat                  <times> Runs the test(s) repeatedly.\r\n--tap                     Report test execution progress in TAP format.\r\n--testdox                 Report test execution progress in TestDox\r\n                          format.\r\n--no-colors               Do not use colors in output.\r\n--stderr                  Write to STDERR instead of STDOUT.\r\n--stop-on-error           Stop execution upon first error or failure.\r\n--stop-on-failure         Stop execution upon first failure.\r\n--stop-on-skipped         Stop execution upon first skipped test.\r\n--stop-on-incomplete      Stop execution upon first incomplete test.\r\n--strict                  Mark a test as incomplete if no assertions are\r\n                          made.\r\n--wait                    Waits for a keystroke after each test.\r\n--process-isolation       Run each test in a separate PHP process.\r\n--no-globals-backup       Do not backup and restore $GLOBALS for each\r\n                          test.\r\n--static-backup           Backup and restore static attributes for each\r\n                          test.\r\n--syntax-check            Try to check source files for syntax errors.\r\n--bootstrap               <file> A \"bootstrap\" PHP file that is run\r\n                          before the tests.\r\n--configuration           <file> Read configuration from XML file.\r\n--no-configuration        Ignore default configuration file\r\n                          (phpunit.xml).\r\n--include-path            <path(s)> Prepend PHP include_path with given\r\n                          path(s).\r\n--directive               key[=value] Sets a php.ini value.\r\n--fixture                 Choose a custom fixture manager.\r\n--debug                   More verbose output.\r\n\r\nArguments:\r\n\r\ncategory  The category for the test, or test file, to test.\r\n          (optional)\r\nfile      The path to the file, or test file, to test.\r\n          (optional)\r\n\r\n\r\n$ Console/cake test --quiet app Controller/PostsController\r\nPHPUnit 3.7.38 by Sebastian Bergmann.\r\n\r\nunrecognized option --quiet\r\n\r\n```\r\n\r\n**`--quiet` would be nice to use with a file watcher like grunt or kicker, to reduce the amount of \"useless\" output when saving a file and auto-executing the corresponding test repeatedly in a tight loop.**\r\n\r\nSince `--quiet` is a Cake-provided switch and does not conflict with PHPUnit, I think it's worth keeping and supporting properly, so I see two possible routes here:\r\n\r\n1. Implement support in the TestShell to recognize the `-q/--quiet` switch just to suppress the Cake welcome banner (as usual for Cake Shells). Basically, remove this stuff from the output when the flag is present:\r\n\r\n\t```\r\n\tWelcome to CakePHP v2.7.1 Console\r\n\t---------------------------------------------------------------\r\n\tApp : www\r\n\tPath: /var/www/\r\n\t---------------------------------------------------------------\r\n\tCakePHP Test Shell\r\n\t---------------------------------------------------------------\r\n\t```\r\n\r\n\tThis would only require making sure the option [does _not_ get passed down](https://github.com/cakephp/cakephp/blob/da969b/lib/Cake/Console/Command/TestShell.php#L224) into the PHPUnit test runner. Unless I'm mistaken, the rest should happen automatically.\r\n\r\n2. Adjust the ConsoleOptionParser to not include the default `--quiet`, `--verbose` and `--help` options. This is accomplished by [passing `false` as the second argument](http://api.cakephp.org/2.7/class-ConsoleOptionParser.html#___construct) [here](https://github.com/cakephp/cakephp/blob/da969b/lib/Cake/Console/Command/TestShell.php#L46). This might also require `addOption()`ing the `--help` and `--verbose` flags explicitly instead of inheriting them as defaults.\r\n\r\n\t(Technically the `verbose` flag is currently being mis-represented by the TestShell: The option and description are provided by Cake and use the Cake-stock messaging, but the flag gets passed down into phpunit and actually effects the run there; it has no effect on the wrapping TestShell.) Here's PHPUnit's own description of the `-v` flag for reference:\r\n\r\n\t```\r\n\t  -v|--verbose              Output more verbose information.\r\n\t```\r\n\r\nI'd be happy to do a quick PR either way. If we don't care too much about the difference in the descriptions for `--verbose` then the first choice is the easy fix."},"comment":{"url":"https://api.github.com/repos/cakephp/cakephp/issues/comments/142155353","html_url":"https://github.com/cakephp/cakephp/issues/7432#issuecomment-142155353","issue_url":"https://api.github.com/repos/cakephp/cakephp/issues/7432","id":142155353,"user":{"login":"markstory","id":24086,"avatar_url":"https://avatars.githubusercontent.com/u/24086?v=3","gravatar_id":"","url":"https://api.github.com/users/markstory","html_url":"https://github.com/markstory","followers_url":"https://api.github.com/users/markstory/followers","following_url":"https://api.github.com/users/markstory/following{/other_user}","gists_url":"https://api.github.com/users/markstory/gists{/gist_id}","starred_url":"https://api.github.com/users/markstory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/markstory/subscriptions","organizations_url":"https://api.github.com/users/markstory/orgs","repos_url":"https://api.github.com/users/markstory/repos","events_url":"https://api.github.com/users/markstory/events{/privacy}","received_events_url":"https://api.github.com/users/markstory/received_events","type":"User","site_admin":false},"created_at":"2015-09-22T01:26:05Z","updated_at":"2015-09-22T01:26:05Z","body":"I'm not too fussy about the differences in help output for the verbose flag. The current docs aren't _wrong_. Removing `--quiet` seems like the best option here."}}