MDL-60342 test: Reset user agent after tests

- Add a test that proves this useragent is not being reset after a test
- Reset user agent
This commit is contained in:
Pat Kira
2017-10-18 14:02:07 +11:00
parent 298c1361e8
commit 74ee81e38e
2 changed files with 22 additions and 0 deletions
+3
View File
@@ -277,6 +277,9 @@ class phpunit_util extends testing_util {
// Reset the log manager cache.
get_log_manager(true);
// Reset user agent.
core_useragent::instance(true, null);
// verify db writes just in case something goes wrong in reset
if (self::$lastdbwrites != $DB->perf_get_writes()) {
error_log('Unexpected DB writes in phpunit_util::reset_all_data()');