File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,9 @@ public function run()
61
61
$ runner = $ this ->createRunner ();
62
62
$ runner ->setEnvironmentVariable (Environment::RUNNER , 1 );
63
63
$ runner ->setEnvironmentVariable (Environment::COLORS , (int ) Environment::$ useColors );
64
+ if (isset ($ coverageFile )) {
65
+ $ runner ->setEnvironmentVariable (Environment::COVERAGE , $ coverageFile );
66
+ }
64
67
65
68
if ($ this ->options ['-o ' ] !== NULL ) {
66
69
ob_clean ();
@@ -74,7 +77,7 @@ public function run()
74
77
75
78
$ result = $ runner ->run ();
76
79
77
- if (isset ($ coverageFile )) {
80
+ if (isset ($ coverageFile ) && preg_match ( ' #\.(?:html?|xml)\z# ' , $ coverageFile ) ) {
78
81
$ this ->finishCodeCoverage ($ coverageFile );
79
82
}
80
83
@@ -214,11 +217,8 @@ private function prepareCodeCoverage()
214
217
}
215
218
file_put_contents ($ this ->options ['--coverage ' ], '' );
216
219
$ file = realpath ($ this ->options ['--coverage ' ]);
217
- putenv (Environment::COVERAGE . '= ' . $ file );
218
220
echo "Code coverage: {$ file }\n" ;
219
- if (preg_match ('#\.(?:html?|xml)\z# ' , $ file )) {
220
- return $ file ;
221
- }
221
+ return $ file ;
222
222
}
223
223
224
224
You can’t perform that action at this time.
0 commit comments