Merge branch 'MDL-58794-master' of git://github.com/junpataleta/moodle
authorDan Poltawski <dan@moodle.com>
Wed, 3 May 2017 12:19:19 +0000 (13:19 +0100)
committerDan Poltawski <dan@moodle.com>
Wed, 3 May 2017 12:19:19 +0000 (13:19 +0100)
course/tests/externallib_test.php

index 24dfab7..a397d24 100644 (file)
@@ -785,10 +785,11 @@ class core_course_externallib_testcase extends externallib_advanced_testcase {
         $label = $this->getDataGenerator()->create_module('label', array('course' => $course->id,
             'intro' => $labeldescription));
         $labelcm = get_coursemodule_from_instance('label', $label->id);
+        $tomorrow = time() + DAYSECS;
         // Module with availability restrictions not met.
         $url = $this->getDataGenerator()->create_module('url',
             array('course' => $course->id, 'name' => 'URL: % & $ ../', 'section' => 2),
-            array('availability' => '{"op":"&","c":[{"type":"date","d":">=","t":2502892800}],"showc":[true]}'));
+            array('availability' => '{"op":"&","c":[{"type":"date","d":">=","t":' . $tomorrow . '}],"showc":[true]}'));
         $urlcm = get_coursemodule_from_instance('url', $url->id);
         // Module for the last section.
         $this->getDataGenerator()->create_module('url',
@@ -809,7 +810,7 @@ class core_course_externallib_testcase extends externallib_advanced_testcase {
         $DB->set_field('course_sections', 'summary', 'Text with iframe <iframe src="https://moodle.org"></iframe>', $conditions);
 
         // Add date availability condition not met for last section.
-        $availability = '{"op":"&","c":[{"type":"date","d":">=","t":2502892800}],"showc":[true]}';
+        $availability = '{"op":"&","c":[{"type":"date","d":">=","t":' . $tomorrow . '}],"showc":[true]}';
         $DB->set_field('course_sections', 'availability', $availability,
                 array('course' => $course->id, 'section' => 3));
         rebuild_course_cache($course->id, true);