Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 11
Línea 27... Línea 27...
27
 * @copyright  2015 Issam Taboubi <issam.taboubi@umontreal.ca>
27
 * @copyright  2015 Issam Taboubi <issam.taboubi@umontreal.ca>
28
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
28
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
29
 */
29
 */
30
class task_test extends \advanced_testcase {
30
class task_test extends \advanced_testcase {
Línea 31... Línea 31...
31
 
31
 
32
    public function test_sync_plans_from_cohorts_task() {
32
    public function test_sync_plans_from_cohorts_task(): void {
Línea 33... Línea 33...
33
        global $DB;
33
        global $DB;
34
 
34
 
35
        $this->resetAfterTest(true);
35
        $this->resetAfterTest(true);
Línea 147... Línea 147...
147
        $task->execute();
147
        $task->execute();
148
        $task->set_last_run_time($currenttime);
148
        $task->set_last_run_time($currenttime);
149
        $this->assertEquals(3, plan::count_records(array('templateid' => $tpl->get('id'))));
149
        $this->assertEquals(3, plan::count_records(array('templateid' => $tpl->get('id'))));
150
    }
150
    }
Línea 151... Línea 151...
151
 
151
 
152
    public function test_sync_plans_from_cohorts_with_templateduedate_task() {
152
    public function test_sync_plans_from_cohorts_with_templateduedate_task(): void {
153
        $this->resetAfterTest(true);
153
        $this->resetAfterTest(true);
154
        $this->setAdminUser();
154
        $this->setAdminUser();
155
        $dg = $this->getDataGenerator();
155
        $dg = $this->getDataGenerator();
Línea 226... Línea 226...
226
 
226
 
227
        $task->execute();
227
        $task->execute();
228
        $this->assertEquals(4, plan::count_records(array('templateid' => $tpl->get('id'))));
228
        $this->assertEquals(4, plan::count_records(array('templateid' => $tpl->get('id'))));
Línea 229... Línea 229...
229
    }
229
    }
230
 
230
 
Línea 231... Línea 231...
231
    public function test_sync_plans_from_cohorts_with_passed_duedate() {
231
    public function test_sync_plans_from_cohorts_with_passed_duedate(): void {
232
        global $DB;
232
        global $DB;
233
 
233
 
Línea 264... Línea 264...
264
        $tpl->update();
264
        $tpl->update();
265
        $task->execute();
265
        $task->execute();
266
        $this->assertEquals(2, plan::count_records()); // Now there is two.
266
        $this->assertEquals(2, plan::count_records()); // Now there is two.
267
    }
267
    }
Línea 268... Línea 268...
268
 
268
 
269
    public function test_complete_plans_task() {
269
    public function test_complete_plans_task(): void {
270
        global $DB;
270
        global $DB;
271
        $this->resetAfterTest(true);
271
        $this->resetAfterTest(true);
272
        $this->setAdminUser();
272
        $this->setAdminUser();
273
        $dg = $this->getDataGenerator();
273
        $dg = $this->getDataGenerator();