From d16a375088e4ff4402a7204d8e4476b6decfd283 Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Thu, 28 Oct 2021 12:56:00 +0200 Subject: [PATCH] MDL-72743 tests: tidy up the new test with NS/name/covers Ideally any new test should be using a class name matching the file name, and to use namespace when clearly belonging to a component (sub-namespace also allowed for better accuracy). And, also, adding a @covers label to indicate which class (preferred, method is also possible) is being covered with the test. --- mod/quiz/tests/restore_attempt_test.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mod/quiz/tests/restore_attempt_test.php b/mod/quiz/tests/restore_attempt_test.php index 71492d0cdb5..5fd21c18c9b 100644 --- a/mod/quiz/tests/restore_attempt_test.php +++ b/mod/quiz/tests/restore_attempt_test.php @@ -14,6 +14,13 @@ // You should have received a copy of the GNU General Public License // along with Moodle. If not, see . +namespace mod_quiz; + +use backup; +use core_user; +use restore_controller; +use restore_dbops; + /** * Unit tests restoring quiz attempts * @@ -21,7 +28,7 @@ * @copyright 2021 Paul Holden * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ -class mod_quiz_restore_attempt_test extends advanced_testcase { +class restore_attempt_test extends \advanced_testcase { /** * Load required libraries @@ -34,6 +41,8 @@ class mod_quiz_restore_attempt_test extends advanced_testcase { /** * Test restore dates. + * + * @covers \restore_quiz_activity_structure_step */ public function test_restore_question_attempts_missing_users(): void { global $DB, $USER;