MDL-85400 PHPunit: Hard to test code that uses encryption
This change stops the encryption code setting created key files to read-only during PHPunit runs, which means they will be safely deleted when the system resets after a test.
This commit is contained in:
committed by
Simey Lameze
parent
4c3df551a4
commit
c56c08e9ce
@@ -84,8 +84,8 @@ class encryption {
|
||||
throw new \moodle_exception('encryption_keyalreadyexists', 'error');
|
||||
}
|
||||
|
||||
// Don't make it read-only in Behat or it will fail to clear for future runs.
|
||||
if (defined('BEHAT_SITE_RUNNING')) {
|
||||
// Don't make it read-only in tests or it will fail to clear for future runs.
|
||||
if (defined('BEHAT_SITE_RUNNING') || PHPUNIT_TEST) {
|
||||
$chmod = false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user