MDL-65220 behat: test scenarios sometimes do not clear database data

This commit is contained in:
Jason Platts 2019-03-29 14:36:19 +00:00
parent 0920f35ed9
commit f7af1e0b9c

View file

@ -926,15 +926,14 @@ abstract class testing_util {
if (defined('BEHAT_SITE_RUNNING')) { if (defined('BEHAT_SITE_RUNNING')) {
$tablesupdatedfile = self::get_tables_updated_by_scenario_list_path(); $tablesupdatedfile = self::get_tables_updated_by_scenario_list_path();
if ($tablesupdated = @json_decode(file_get_contents($tablesupdatedfile), true)) { $tablesupdated = @json_decode(file_get_contents($tablesupdatedfile), true);
if (!isset($tablesupdated[$table])) {
$tablesupdated[$table] = true; $tablesupdated[$table] = true;
} else {
$tablesupdated[$table] = true;
}
@file_put_contents($tablesupdatedfile, json_encode($tablesupdated, JSON_PRETTY_PRINT)); @file_put_contents($tablesupdatedfile, json_encode($tablesupdated, JSON_PRETTY_PRINT));
} }
} }
} }
}
/** /**
* Reset updated table list. This should be done after every reset. * Reset updated table list. This should be done after every reset.