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:
Petr Skoda
2014-04-28 17:13:29 +08:00
parent 14df84f65e
commit 2e123e7120
2 changed files with 26 additions and 11 deletions
-11
View File
@@ -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;
}