MDL-46514 behat: Delete tablesupdatedbyscenario before suite
Delete tablesupdatedbyscenario before db reset to ensure db is fully reset. In case user exits or process terminated then the file will be left and can lead to wrong results
This commit is contained in:
@@ -939,12 +939,23 @@ abstract class testing_util {
|
||||
self::$tableupdated = array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete tablesupdatedbyscenario file. This should be called before suite,
|
||||
* to ensure full db reset.
|
||||
*/
|
||||
public static function clean_tables_updated_by_scenario_list() {
|
||||
$tablesupdatedfile = self::get_tables_updated_by_scenario_list_path();
|
||||
if (file_exists($tablesupdatedfile)) {
|
||||
unlink($tablesupdatedfile);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the path to the file which holds list of tables updated in scenario.
|
||||
* @return string
|
||||
*/
|
||||
protected final static function get_tables_updated_by_scenario_list_path() {
|
||||
return self::get_dataroot() . '/tablesupdatedbyscenario.txt';
|
||||
return self::get_dataroot() . '/tablesupdatedbyscenario.json';
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user