MDL-45287 fix behat database reset between scenarios
We cannot find out if DB received any writes because behat web access runs in different request. This was affecting only scenarios without generators.
This commit is contained in:
@@ -39,11 +39,6 @@ abstract class testing_util {
|
||||
*/
|
||||
private static $dataroot = null;
|
||||
|
||||
/**
|
||||
* @var int last value of db writes counter, used for db resetting
|
||||
*/
|
||||
public static $lastdbwrites = null;
|
||||
|
||||
/**
|
||||
* @var testing_data_generator
|
||||
*/
|
||||
@@ -549,10 +544,6 @@ abstract class testing_util {
|
||||
public static function reset_database() {
|
||||
global $DB;
|
||||
|
||||
if (!is_null(self::$lastdbwrites) and self::$lastdbwrites == $DB->perf_get_writes()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$tables = $DB->get_tables(false);
|
||||
if (!$tables or empty($tables['config'])) {
|
||||
// not installed yet
|
||||
@@ -681,8 +672,6 @@ abstract class testing_util {
|
||||
}
|
||||
}
|
||||
|
||||
self::$lastdbwrites = $DB->perf_get_writes();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user