File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,9 @@ public function run()
6161 $ runner = $ this ->createRunner ();
6262 $ runner ->setEnvironmentVariable (Environment::RUNNER , 1 );
6363 $ runner ->setEnvironmentVariable (Environment::COLORS , (int ) Environment::$ useColors );
64+ if (isset ($ coverageFile )) {
65+ $ runner ->setEnvironmentVariable (Environment::COVERAGE , $ coverageFile );
66+ }
6467
6568 if ($ this ->options ['-o ' ] !== NULL ) {
6669 ob_clean ();
@@ -74,7 +77,7 @@ public function run()
7477
7578 $ result = $ runner ->run ();
7679
77- if (isset ($ coverageFile )) {
80+ if (isset ($ coverageFile ) && preg_match ( ' #\.(?:html?|xml)\z# ' , $ coverageFile ) ) {
7881 $ this ->finishCodeCoverage ($ coverageFile );
7982 }
8083
@@ -214,11 +217,8 @@ private function prepareCodeCoverage()
214217 }
215218 file_put_contents ($ this ->options ['--coverage ' ], '' );
216219 $ file = realpath ($ this ->options ['--coverage ' ]);
217- putenv (Environment::COVERAGE . '= ' . $ file );
218220 echo "Code coverage: {$ file }\n" ;
219- if (preg_match ('#\.(?:html?|xml)\z# ' , $ file )) {
220- return $ file ;
221- }
221+ return $ file ;
222222 }
223223
224224
You can’t perform that action at this time.
0 commit comments