Skip to content

Commit b866ca5

Browse files
committed
updated c3 to create tmp dirs
1 parent 4091388 commit b866ca5

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

c3.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,14 @@ function __c3_clear()
248248
if (!array_key_exists('HTTP_X_CODECEPTION_CODECOVERAGE_DEBUG', $_SERVER)) {
249249
register_shutdown_function(
250250
function () use ($codeCoverage, $current_report) {
251+
251252
$codeCoverage->stop();
253+
if (!file_exists(dirname($current_report))) { // verify directory exists
254+
mkdir(dirname($current_report), 0777, true);
255+
} else {
256+
__c3_error("Can't write CodeCoverage report into $current_report");
257+
}
258+
252259
file_put_contents($current_report, serialize($codeCoverage));
253260
}
254261
);

0 commit comments

Comments
 (0)