While debugging for this issue Codeception/Codeception#4871, I keep getting message Could not write error to log file.
When I traced the cause, it's from here.
|
$errorLogFile = defined('C3_CODECOVERAGE_ERROR_LOG_FILE') ? |
|
C3_CODECOVERAGE_ERROR_LOG_FILE : |
|
C3_CODECOVERAGE_MEDIATE_STORAGE . DIRECTORY_SEPARATOR . 'error.txt'; |
|
if (is_writable($errorLogFile)) { |
|
file_put_contents($errorLogFile, $message); |
|
} else { |
|
$message = "Could not write error to log file ($errorLogFile), original message: $message"; |
|
} |
Apparently the c3tmp directory is always emptied by __c3_clear() when the test is executed.
|
if ($route === 'clear') { |
|
__c3_clear(); |
|
return __c3_exit(); |
|
} |
This cause problem because is_writable returns true if the file exists and is writable.
http://php.net/manual/en/function.is-writable.php