MDL-55143 unittests: Check the db rather than cache for version hash.

This commit is contained in:
Russell Smith
2016-10-18 09:53:24 +11:00
parent 0b70ff8a16
commit 0a97a2e574
+3 -2
View File
@@ -186,7 +186,7 @@ abstract class testing_util {
* @return bool
*/
public static function is_test_data_updated() {
global $CFG;
global $DB;
$framework = self::get_framework();
@@ -206,7 +206,8 @@ abstract class testing_util {
return false;
}
$dbhash = get_config('core', $framework . 'test');
// A direct database request must be used to avoid any possible caching of an older value.
$dbhash = $DB->get_field('config', 'value', array('name' => $framework . 'test'));
if ($hash !== $dbhash) {
return false;
}