| Línea 37... |
Línea 37... |
| 37 |
|
37 |
|
| 38 |
/**
|
38 |
/**
|
| 39 |
* Restoring a manual grade item does not result in the timecreated or
|
39 |
* Restoring a manual grade item does not result in the timecreated or
|
| 40 |
* timemodified dates being changed.
|
40 |
* timemodified dates being changed.
|
| 41 |
*/
|
41 |
*/
|
| Línea 42... |
Línea 42... |
| 42 |
public function test_grade_item_date_restore() {
|
42 |
public function test_grade_item_date_restore(): void {
|
| Línea 43... |
Línea 43... |
| 43 |
|
43 |
|
| 44 |
$course = $this->getDataGenerator()->create_course(['startdate' => time()]);
|
44 |
$course = $this->getDataGenerator()->create_course(['startdate' => time()]);
|
| Línea 96... |
Línea 96... |
| 96 |
|
96 |
|
| 97 |
/**
|
97 |
/**
|
| 98 |
* The course section timemodified date does not get rolled forward
|
98 |
* The course section timemodified date does not get rolled forward
|
| 99 |
* when the course is restored.
|
99 |
* when the course is restored.
|
| 100 |
*/
|
100 |
*/
|
| 101 |
public function test_course_section_date_restore() {
|
101 |
public function test_course_section_date_restore(): void {
|
| 102 |
global $DB;
|
102 |
global $DB;
|
| 103 |
// Create a course.
|
103 |
// Create a course.
|
| 104 |
$course = $this->getDataGenerator()->create_course(['startdate' => time()]);
|
104 |
$course = $this->getDataGenerator()->create_course(['startdate' => time()]);
|
| 105 |
// Get the second course section.
|
105 |
// Get the second course section.
|
| Línea 115... |
Línea 115... |
| 115 |
|
115 |
|
| 116 |
/**
|
116 |
/**
|
| 117 |
* Test that the timecreated and timemodified dates are not rolled forward when restoring
|
117 |
* Test that the timecreated and timemodified dates are not rolled forward when restoring
|
| 118 |
* badge data.
|
118 |
* badge data.
|
| 119 |
*/
|
119 |
*/
|
| 120 |
public function test_badge_date_restore() {
|
120 |
public function test_badge_date_restore(): void {
|
| 121 |
global $DB, $USER;
|
121 |
global $DB, $USER;
|
| 122 |
// Create a course.
|
122 |
// Create a course.
|
| 123 |
$course = $this->getDataGenerator()->create_course(['startdate' => time()]);
|
123 |
$course = $this->getDataGenerator()->create_course(['startdate' => time()]);
|
| 124 |
// Create a badge.
|
124 |
// Create a badge.
|
| Línea 162... |
Línea 162... |
| 162 |
|
162 |
|
| 163 |
/**
|
163 |
/**
|
| 164 |
* Test that course calendar events timemodified field is not rolled forward
|
164 |
* Test that course calendar events timemodified field is not rolled forward
|
| 165 |
* when restoring the course.
|
165 |
* when restoring the course.
|
| 166 |
*/
|
166 |
*/
|
| 167 |
public function test_calendarevents_date_restore() {
|
167 |
public function test_calendarevents_date_restore(): void {
|
| 168 |
global $USER, $DB;
|
168 |
global $USER, $DB;
|
| 169 |
// Create course.
|
169 |
// Create course.
|
| 170 |
$course = $this->getDataGenerator()->create_course(['startdate' => time()]);
|
170 |
$course = $this->getDataGenerator()->create_course(['startdate' => time()]);
|
| 171 |
// Create calendar event.
|
171 |
// Create calendar event.
|
| Línea 198... |
Línea 198... |
| 198 |
|
198 |
|
| 199 |
/**
|
199 |
/**
|
| 200 |
* Testing that the timeenrolled, timestarted, and timecompleted fields are not rolled forward / back
|
200 |
* Testing that the timeenrolled, timestarted, and timecompleted fields are not rolled forward / back
|
| 201 |
* when doing a course restore.
|
201 |
* when doing a course restore.
|
| 202 |
*/
|
202 |
*/
|
| 203 |
public function test_course_completion_date_restore() {
|
203 |
public function test_course_completion_date_restore(): void {
|
| Línea 204... |
Línea 204... |
| 204 |
global $DB;
|
204 |
global $DB;
|
| 205 |
|
205 |
|
| Línea 234... |
Línea 234... |
| 234 |
|
234 |
|
| 235 |
/**
|
235 |
/**
|
| 236 |
* Testing that the grade grade date information is not changed in the gradebook when a course
|
236 |
* Testing that the grade grade date information is not changed in the gradebook when a course
|
| 237 |
* restore is performed.
|
237 |
* restore is performed.
|
| 238 |
*/
|
238 |
*/
|
| 239 |
public function test_grade_grade_date_restore() {
|
239 |
public function test_grade_grade_date_restore(): void {
|
| 240 |
global $USER, $DB;
|
240 |
global $USER, $DB;
|
| 241 |
// Testing the restore of an overridden grade.
|
241 |
// Testing the restore of an overridden grade.
|
| 242 |
list($course, $assign) = $this->create_course_and_module('assign', []);
|
242 |
list($course, $assign) = $this->create_course_and_module('assign', []);
|
| 243 |
$cm = $DB->get_record('course_modules', ['course' => $course->id, 'instance' => $assign->id]);
|
243 |
$cm = $DB->get_record('course_modules', ['course' => $course->id, 'instance' => $assign->id]);
|
| Línea 285... |
Línea 285... |
| 285 |
|
285 |
|
| 286 |
/**
|
286 |
/**
|
| 287 |
* Checking that the user completion of an activity relating to the timemodified field does not change
|
287 |
* Checking that the user completion of an activity relating to the timemodified field does not change
|
| 288 |
* when doing a course restore.
|
288 |
* when doing a course restore.
|
| 289 |
*/
|
289 |
*/
|
| 290 |
public function test_usercompletion_date_restore() {
|
290 |
public function test_usercompletion_date_restore(): void {
|
| 291 |
global $USER, $DB;
|
291 |
global $USER, $DB;
|
| 292 |
// More completion...
|
292 |
// More completion...
|
| 293 |
$course = $this->getDataGenerator()->create_course(['startdate' => time(), 'enablecompletion' => 1]);
|
293 |
$course = $this->getDataGenerator()->create_course(['startdate' => time(), 'enablecompletion' => 1]);
|
| 294 |
$assign = $this->getDataGenerator()->create_module('assign', [
|
294 |
$assign = $this->getDataGenerator()->create_module('assign', [
|
| Línea 320... |
Línea 320... |
| 320 |
/**
|
320 |
/**
|
| 321 |
* Checking that the user completion of an activity relating to the view field does not change
|
321 |
* Checking that the user completion of an activity relating to the view field does not change
|
| 322 |
* when doing a course restore.
|
322 |
* when doing a course restore.
|
| 323 |
* @covers ::backup_and_restore
|
323 |
* @covers ::backup_and_restore
|
| 324 |
*/
|
324 |
*/
|
| 325 |
public function test_usercompletion_view_restore() {
|
325 |
public function test_usercompletion_view_restore(): void {
|
| 326 |
global $DB;
|
326 |
global $DB;
|
| 327 |
// More completion...
|
327 |
// More completion...
|
| 328 |
$course = $this->getDataGenerator()->create_course(['startdate' => time(), 'enablecompletion' => 1]);
|
328 |
$course = $this->getDataGenerator()->create_course(['startdate' => time(), 'enablecompletion' => 1]);
|
| 329 |
$student = $this->getDataGenerator()->create_user();
|
329 |
$student = $this->getDataGenerator()->create_user();
|
| 330 |
$this->getDataGenerator()->enrol_user($student->id, $course->id, 'student');
|
330 |
$this->getDataGenerator()->enrol_user($student->id, $course->id, 'student');
|
| Línea 354... |
Línea 354... |
| 354 |
|
354 |
|
| 355 |
/**
|
355 |
/**
|
| 356 |
* Ensuring that the timemodified field of the question attempt steps table does not change when
|
356 |
* Ensuring that the timemodified field of the question attempt steps table does not change when
|
| 357 |
* a course restore is done.
|
357 |
* a course restore is done.
|
| 358 |
*/
|
358 |
*/
|
| 359 |
public function test_question_attempt_steps_date_restore() {
|
359 |
public function test_question_attempt_steps_date_restore(): void {
|
| Línea 360... |
Línea 360... |
| 360 |
global $DB;
|
360 |
global $DB;
|
| 361 |
|
361 |
|
| 362 |
$course = $this->getDataGenerator()->create_course(['startdate' => time()]);
|
362 |
$course = $this->getDataGenerator()->create_course(['startdate' => time()]);
|