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:03:24 +11:00
parent 9a316f3367
commit 5a97f26be9
2 changed files with 22 additions and 0 deletions
+3
View File
@@ -278,6 +278,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()');