Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 136... Línea 136...
136
        $this->getDataGenerator()->enrol_user($return->user->id, $return->courses->course1->id);
136
        $this->getDataGenerator()->enrol_user($return->user->id, $return->courses->course1->id);
Línea 137... Línea 137...
137
 
137
 
138
        return $return;
138
        return $return;
Línea 139... Línea 139...
139
    }
139
    }
140
 
140
 
Línea 141... Línea 141...
141
    public function test_set_maildigest() {
141
    public function test_set_maildigest(): void {
Línea 142... Línea 142...
142
        global $DB;
142
        global $DB;
Línea 192... Línea 192...
192
        // Try with an invalid value.
192
        // Try with an invalid value.
193
        $this->expectException('moodle_exception');
193
        $this->expectException('moodle_exception');
194
        forum_set_user_maildigest($forum1, 42, $user);
194
        forum_set_user_maildigest($forum1, 42, $user);
195
    }
195
    }
Línea 196... Línea 196...
196
 
196
 
197
    public function test_get_user_digest_options_default() {
197
    public function test_get_user_digest_options_default(): void {
Línea 198... Línea 198...
198
        global $USER, $DB;
198
        global $USER, $DB;
Línea 199... Línea 199...
199
 
199
 
Línea 231... Línea 231...
231
        $this->assertEquals(2, $USER->maildigest);
231
        $this->assertEquals(2, $USER->maildigest);
232
        $options = forum_get_user_digest_options();
232
        $options = forum_get_user_digest_options();
233
        $this->assertEquals($options[-1], get_string('emaildigestdefault', 'mod_forum', $digestoptions[2]));
233
        $this->assertEquals($options[-1], get_string('emaildigestdefault', 'mod_forum', $digestoptions[2]));
234
    }
234
    }
Línea 235... Línea 235...
235
 
235
 
236
    public function test_get_user_digest_options_sorting() {
236
    public function test_get_user_digest_options_sorting(): void {
Línea 237... Línea 237...
237
        global $USER, $DB;
237
        global $USER, $DB;
Línea 238... Línea 238...
238
 
238
 
Línea 256... Línea 256...
256
            $this->assertGreaterThan($lastoption, $value);
256
            $this->assertGreaterThan($lastoption, $value);
257
            $lastoption = $value;
257
            $lastoption = $value;
258
        }
258
        }
259
    }
259
    }
Línea 260... Línea 260...
260
 
260
 
261
    public function test_cron_no_posts() {
261
    public function test_cron_no_posts(): void {
Línea 262... Línea 262...
262
        global $DB;
262
        global $DB;
Línea 263... Línea 263...
263
 
263
 
Línea 270... Línea 270...
270
 
270
 
271
    /**
271
    /**
272
     * Sends several notifications to one user as:
272
     * Sends several notifications to one user as:
273
     * * single messages based on a user profile setting.
273
     * * single messages based on a user profile setting.
274
     */
274
     */
275
    public function test_cron_profile_single_mails() {
275
    public function test_cron_profile_single_mails(): void {
Línea 276... Línea 276...
276
        global $DB;
276
        global $DB;
Línea 277... Línea 277...
277
 
277
 
Línea 321... Línea 321...
321
 
321
 
322
    /**
322
    /**
323
     * Sends several notifications to one user as:
323
     * Sends several notifications to one user as:
324
     * * daily digests coming from the user profile setting.
324
     * * daily digests coming from the user profile setting.
325
     */
325
     */
326
    public function test_cron_profile_digest_email() {
326
    public function test_cron_profile_digest_email(): void {
Línea 327... Línea 327...
327
        global $DB, $CFG;
327
        global $DB, $CFG;
Línea 328... Línea 328...
328
 
328
 
Línea 371... Línea 371...
371
    }
371
    }
Línea 372... Línea 372...
372
 
372
 
373
    /**
373
    /**
374
     * Send digests to a user who cannot view fullnames
374
     * Send digests to a user who cannot view fullnames
375
     */
375
     */
376
    public function test_cron_digest_view_fullnames_off() {
376
    public function test_cron_digest_view_fullnames_off(): void {
Línea 377... Línea 377...
377
        global $DB, $CFG;
377
        global $DB, $CFG;
378
 
378
 
Línea 417... Línea 417...
417
    }
417
    }
Línea 418... Línea 418...
418
 
418
 
419
    /**
419
    /**
420
     * Send digests to a user who can view fullnames.
420
     * Send digests to a user who can view fullnames.
421
     */
421
     */
422
    public function test_cron_digest_view_fullnames_on() {
422
    public function test_cron_digest_view_fullnames_on(): void {
Línea 423... Línea 423...
423
        global $DB, $CFG;
423
        global $DB, $CFG;
424
 
424
 
Línea 472... Línea 472...
472
    /**
472
    /**
473
     * Sends several notifications to one user as:
473
     * Sends several notifications to one user as:
474
     * * daily digests coming from the per-forum setting; and
474
     * * daily digests coming from the per-forum setting; and
475
     * * single e-mails from the profile setting.
475
     * * single e-mails from the profile setting.
476
     */
476
     */
477
    public function test_cron_mixed_email_1() {
477
    public function test_cron_mixed_email_1(): void {
478
        global $DB, $CFG;
478
        global $DB, $CFG;
Línea 479... Línea 479...
479
 
479
 
Línea 480... Línea 480...
480
        $this->resetAfterTest(true);
480
        $this->resetAfterTest(true);
Línea 526... Línea 526...
526
    /**
526
    /**
527
     * Sends several notifications to one user as:
527
     * Sends several notifications to one user as:
528
     * * single e-mails from the per-forum setting; and
528
     * * single e-mails from the per-forum setting; and
529
     * * daily digests coming from the per-user setting.
529
     * * daily digests coming from the per-user setting.
530
     */
530
     */
531
    public function test_cron_mixed_email_2() {
531
    public function test_cron_mixed_email_2(): void {
532
        global $DB, $CFG;
532
        global $DB, $CFG;
Línea 533... Línea 533...
533
 
533
 
Línea 534... Línea 534...
534
        $this->resetAfterTest(true);
534
        $this->resetAfterTest(true);
Línea 579... Línea 579...
579
 
579
 
580
    /**
580
    /**
581
     * Sends several notifications to one user as:
581
     * Sends several notifications to one user as:
582
     * * daily digests coming from the per-forum setting.
582
     * * daily digests coming from the per-forum setting.
583
     */
583
     */
584
    public function test_cron_forum_digest_email() {
584
    public function test_cron_forum_digest_email(): void {
Línea 585... Línea 585...
585
        global $DB, $CFG;
585
        global $DB, $CFG;
Línea 586... Línea 586...
586
 
586
 
Línea 629... Línea 629...
629
    }
629
    }
Línea 630... Línea 630...
630
 
630
 
631
    /**
631
    /**
632
     * The digest being in the past is queued til the next day.
632
     * The digest being in the past is queued til the next day.
633
     */
633
     */
634
    public function test_cron_digest_previous_day() {
634
    public function test_cron_digest_previous_day(): void {
Línea 635... Línea 635...
635
        global $DB, $CFG;
635
        global $DB, $CFG;
Línea 636... Línea 636...
636
 
636
 
Línea 669... Línea 669...
669
    }
669
    }
Línea 670... Línea 670...
670
 
670
 
671
    /**
671
    /**
672
     * The digest being in the future is queued for today.
672
     * The digest being in the future is queued for today.
673
     */
673
     */
674
    public function test_cron_digest_same_day() {
674
    public function test_cron_digest_same_day(): void {
Línea 675... Línea 675...
675
        global $DB, $CFG;
675
        global $DB, $CFG;
Línea 676... Línea 676...
676
 
676
 
Línea 711... Línea 711...
711
 
711
 
712
    /**
712
    /**
713
     * Tests that if a new message is posted after the days digest time,
713
     * Tests that if a new message is posted after the days digest time,
714
     * but before that days digests are sent a new task is created.
714
     * but before that days digests are sent a new task is created.
715
     */
715
     */
716
    public function test_cron_digest_queue_next_before_current_processed() {
716
    public function test_cron_digest_queue_next_before_current_processed(): void {
Línea 717... Línea 717...
717
        global $DB, $CFG;
717
        global $DB, $CFG;
Línea 718... Línea 718...
718
 
718
 
Línea 777... Línea 777...
777
    }
777
    }
Línea 778... Línea 778...
778
 
778
 
779
    /**
779
    /**
780
     * The sending of a digest marks posts as read if automatic message read marking is set.
780
     * The sending of a digest marks posts as read if automatic message read marking is set.
781
     */
781
     */
782
    public function test_cron_digest_marks_posts_read() {
782
    public function test_cron_digest_marks_posts_read(): void {
Línea 783... Línea 783...
783
        global $DB, $CFG;
783
        global $DB, $CFG;
Línea 784... Línea 784...
784
 
784
 
Línea 834... Línea 834...
834
    }
834
    }
Línea 835... Línea 835...
835
 
835
 
836
    /**
836
    /**
837
     * The sending of a digest does not mark posts as read when manual message read marking is set.
837
     * The sending of a digest does not mark posts as read when manual message read marking is set.
838
     */
838
     */
839
    public function test_cron_digest_leaves_posts_unread() {
839
    public function test_cron_digest_leaves_posts_unread(): void {
Línea 840... Línea 840...
840
        global $DB, $CFG;
840
        global $DB, $CFG;
Línea 841... Línea 841...
841
 
841