From 0a97a2e574530d27bb220c2220c475a814be2a67 Mon Sep 17 00:00:00 2001 From: Russell Smith Date: Tue, 18 Oct 2016 09:35:22 +1100 Subject: [PATCH] MDL-55143 unittests: Check the db rather than cache for version hash. --- lib/testing/classes/util.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/testing/classes/util.php b/lib/testing/classes/util.php index fdb4e4e81ce..f3c04a3ed08 100644 --- a/lib/testing/classes/util.php +++ b/lib/testing/classes/util.php @@ -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; }