From: Eloy Lafuente (stronk7) Date: Sun, 18 Apr 2021 21:43:13 +0000 (+0200) Subject: MDL-71367 unit tests: Add missing ->destroy() call to test backups X-Git-Tag: v4.0.0-beta~1510^2 X-Git-Url: http://git.moodle.org/gw?p=moodle.git;a=commitdiff_plain;h=fc530b1837dae1b1dad02d1be0eecc8c898de05b;ds=sidebyside MDL-71367 unit tests: Add missing ->destroy() call to test backups As part of the tests preparations, some backups are created, but the tests aren't calling to their ->destroy() method at the end. The destroy() method is needed to go cleaning and unsetting various objects that, only then, will free resources, like memory, open files... This isn't critical under Unix OSs... but Windows is really sensible and keeps all open files locked, so any write operation on them fails. --- diff --git a/backup/tests/backup_cleanup_task_test.php b/backup/tests/backup_cleanup_task_test.php index e4b71c8c9d5..98fdbb314fd 100644 --- a/backup/tests/backup_cleanup_task_test.php +++ b/backup/tests/backup_cleanup_task_test.php @@ -60,6 +60,7 @@ class core_backup_cleanup_task_testcase extends advanced_testcase { $user->id ); $controller->execute_plan(); + $controller->destroy(); // Unset all structures, close files... return $controller->get_backupid(); }