@@ -98,64 +98,66 @@ private function loadOptions(): CommandLine
9898 $ outputFiles = [];
9999
100100 echo <<<'XX'
101- _____ ___ ___ _____ ___ ___
102- |_ _/ __)( __/_ _/ __)| _ )
103- |_| \___ /___) |_| \___ |_|_\ v2.4.3
104-
105-
106- XX;
107-
108- $ cmd = new CommandLine (<<<'XX'
109- Usage:
110- tester [options] [<test file> | <directory>]...
111-
112- Options:
113- -p <path> Specify PHP interpreter to run (default: php).
114- -c <path> Look for php.ini file (or look in directory) <path>.
115- -C Use system-wide php.ini.
116- -d <key=value>... Define INI entry 'key' with value 'value'.
117- -s Show information about skipped tests.
118- --stop-on-fail Stop execution upon the first failure.
119- -j <num> Run <num> jobs in parallel (default: 8).
120- -o <console|tap|junit|log|none> (e.g. -o junit:output.xml)
121- Specify one or more output formats with optional file name.
122- -w | --watch <path> Watch directory.
123- -i | --info Show tests environment info and exit.
124- --setup <path> Script for runner setup.
125- --temp <path> Path to temporary directory. Default by sys_get_temp_dir().
126- --colors [1|0] Enable or disable colors.
127- --coverage <path> Generate code coverage report to file.
128- --coverage-src <path> Path to source code.
129- -h | --help This help.
130-
131- XX
132- , [
133- '-c ' => [CommandLine::Realpath => true ],
134- '--watch ' => [CommandLine::Repeatable => true , CommandLine::Realpath => true ],
135- '--setup ' => [CommandLine::Realpath => true ],
136- '--temp ' => [CommandLine::Realpath => true ],
137- 'paths ' => [CommandLine::Repeatable => true , CommandLine::Value => getcwd ()],
138- '--debug ' => [],
139- '--cider ' => [],
140- '--coverage-src ' => [CommandLine::Realpath => true , CommandLine::Repeatable => true ],
141- '-o ' => [CommandLine::Repeatable => true , CommandLine::Normalizer => function ($ arg ) use (&$ outputFiles ) {
142- [$ format , $ file ] = explode (': ' , $ arg , 2 ) + [1 => null ];
143-
144- if (isset ($ outputFiles [$ file ])) {
145- throw new \Exception (
146- $ file === null
147- ? 'Option -o <format> without file name parameter can be used only once. '
148- : "Cannot specify output by -o into file ' $ file' more then once. "
149- );
150- } elseif ($ file === null ) {
151- $ this ->stdoutFormat = $ format ;
152- }
101+ _____ ___ ___ _____ ___ ___
102+ |_ _/ __)( __/_ _/ __)| _ )
103+ |_| \___ /___) |_| \___ |_|_\ v2.4.3
104+
105+
106+ XX;
107+
108+ $ cmd = new CommandLine (
109+ <<<'XX'
110+ Usage:
111+ tester [options] [<test file> | <directory>]...
112+
113+ Options:
114+ -p <path> Specify PHP interpreter to run (default: php).
115+ -c <path> Look for php.ini file (or look in directory) <path>.
116+ -C Use system-wide php.ini.
117+ -d <key=value>... Define INI entry 'key' with value 'value'.
118+ -s Show information about skipped tests.
119+ --stop-on-fail Stop execution upon the first failure.
120+ -j <num> Run <num> jobs in parallel (default: 8).
121+ -o <console|tap|junit|log|none> (e.g. -o junit:output.xml)
122+ Specify one or more output formats with optional file name.
123+ -w | --watch <path> Watch directory.
124+ -i | --info Show tests environment info and exit.
125+ --setup <path> Script for runner setup.
126+ --temp <path> Path to temporary directory. Default by sys_get_temp_dir().
127+ --colors [1|0] Enable or disable colors.
128+ --coverage <path> Generate code coverage report to file.
129+ --coverage-src <path> Path to source code.
130+ -h | --help This help.
131+
132+ XX,
133+ [
134+ '-c ' => [CommandLine::Realpath => true ],
135+ '--watch ' => [CommandLine::Repeatable => true , CommandLine::Realpath => true ],
136+ '--setup ' => [CommandLine::Realpath => true ],
137+ '--temp ' => [CommandLine::Realpath => true ],
138+ 'paths ' => [CommandLine::Repeatable => true , CommandLine::Value => getcwd ()],
139+ '--debug ' => [],
140+ '--cider ' => [],
141+ '--coverage-src ' => [CommandLine::Realpath => true , CommandLine::Repeatable => true ],
142+ '-o ' => [CommandLine::Repeatable => true , CommandLine::Normalizer => function ($ arg ) use (&$ outputFiles ) {
143+ [$ format , $ file ] = explode (': ' , $ arg , 2 ) + [1 => null ];
144+
145+ if (isset ($ outputFiles [$ file ])) {
146+ throw new \Exception (
147+ $ file === null
148+ ? 'Option -o <format> without file name parameter can be used only once. '
149+ : "Cannot specify output by -o into file ' $ file' more then once. "
150+ );
151+ } elseif ($ file === null ) {
152+ $ this ->stdoutFormat = $ format ;
153+ }
153154
154- $ outputFiles [$ file ] = true ;
155+ $ outputFiles [$ file ] = true ;
155156
156- return [$ format , $ file ];
157- }],
158- ]);
157+ return [$ format , $ file ];
158+ }],
159+ ]
160+ );
159161
160162 if (isset ($ _SERVER ['argv ' ])) {
161163 if (($ tmp = array_search ('-l ' , $ _SERVER ['argv ' ], true ))
0 commit comments