Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 76... Línea 76...
76
    }
76
    }
Línea 77... Línea 77...
77
 
77
 
78
    /**
78
    /**
79
     * Test parse_rrule() method.
79
     * Test parse_rrule() method.
80
     */
80
     */
81
    public function test_parse_rrule() {
81
    public function test_parse_rrule(): void {
82
        $rules = [
82
        $rules = [
83
            'FREQ=YEARLY',
83
            'FREQ=YEARLY',
84
            'COUNT=3',
84
            'COUNT=3',
85
            'INTERVAL=4',
85
            'INTERVAL=4',
Línea 129... Línea 129...
129
    }
129
    }
Línea 130... Línea 130...
130
 
130
 
131
    /**
131
    /**
132
     * Test exception is thrown for invalid property.
132
     * Test exception is thrown for invalid property.
133
     */
133
     */
134
    public function test_parse_rrule_validation() {
134
    public function test_parse_rrule_validation(): void {
135
        $rrule = "RANDOM=PROPERTY;";
135
        $rrule = "RANDOM=PROPERTY;";
136
        $mang = new rrule_manager($rrule);
136
        $mang = new rrule_manager($rrule);
137
        $this->expectException('moodle_exception');
137
        $this->expectException('moodle_exception');
138
        $mang->parse_rrule();
138
        $mang->parse_rrule();
Línea 139... Línea 139...
139
    }
139
    }
140
 
140
 
141
    /**
141
    /**
142
     * Test exception is thrown for invalid frequency.
142
     * Test exception is thrown for invalid frequency.
143
     */
143
     */
144
    public function test_freq_validation() {
144
    public function test_freq_validation(): void {
145
        $rrule = "FREQ=RANDOMLY;";
145
        $rrule = "FREQ=RANDOMLY;";
146
        $mang = new rrule_manager($rrule);
146
        $mang = new rrule_manager($rrule);
147
        $this->expectException('moodle_exception');
147
        $this->expectException('moodle_exception');
Línea 148... Línea 148...
148
        $mang->parse_rrule();
148
        $mang->parse_rrule();
149
    }
149
    }
150
 
150
 
151
    /**
151
    /**
152
     * Test parsing of rules with both COUNT and UNTIL parameters.
152
     * Test parsing of rules with both COUNT and UNTIL parameters.
153
     */
153
     */
154
    public function test_until_count_validation() {
154
    public function test_until_count_validation(): void {
155
        $until = $this->event->timestart + DAYSECS * 4;
155
        $until = $this->event->timestart + DAYSECS * 4;
156
        $until = date('Y-m-d', $until);
156
        $until = date('Y-m-d', $until);
Línea 161... Línea 161...
161
    }
161
    }
Línea 162... Línea 162...
162
 
162
 
163
    /**
163
    /**
164
     * Test parsing of INTERVAL rule.
164
     * Test parsing of INTERVAL rule.
165
     */
165
     */
166
    public function test_interval_validation() {
166
    public function test_interval_validation(): void {
167
        $rrule = "INTERVAL=0";
167
        $rrule = "INTERVAL=0";
168
        $mang = new rrule_manager($rrule);
168
        $mang = new rrule_manager($rrule);
169
        $this->expectException('moodle_exception');
169
        $this->expectException('moodle_exception');
170
        $mang->parse_rrule();
170
        $mang->parse_rrule();
Línea 171... Línea 171...
171
    }
171
    }
172
 
172
 
173
    /**
173
    /**
174
     * Test parsing of BYSECOND rule.
174
     * Test parsing of BYSECOND rule.
175
     */
175
     */
176
    public function test_bysecond_validation() {
176
    public function test_bysecond_validation(): void {
177
        $rrule = "BYSECOND=30,45,60";
177
        $rrule = "BYSECOND=30,45,60";
178
        $mang = new rrule_manager($rrule);
178
        $mang = new rrule_manager($rrule);
179
        $this->expectException('moodle_exception');
179
        $this->expectException('moodle_exception');
Línea 180... Línea 180...
180
        $mang->parse_rrule();
180
        $mang->parse_rrule();
181
    }
181
    }
182
 
182
 
183
    /**
183
    /**
184
     * Test parsing of BYMINUTE rule.
184
     * Test parsing of BYMINUTE rule.
185
     */
185
     */
186
    public function test_byminute_validation() {
186
    public function test_byminute_validation(): void {
187
        $rrule = "BYMINUTE=30,45,60";
187
        $rrule = "BYMINUTE=30,45,60";
188
        $mang = new rrule_manager($rrule);
188
        $mang = new rrule_manager($rrule);
Línea 189... Línea 189...
189
        $this->expectException('moodle_exception');
189
        $this->expectException('moodle_exception');
190
        $mang->parse_rrule();
190
        $mang->parse_rrule();
191
    }
191
    }
192
 
192
 
193
    /**
193
    /**
194
     * Test parsing of BYMINUTE rule.
194
     * Test parsing of BYMINUTE rule.
195
     */
195
     */
196
    public function test_byhour_validation() {
196
    public function test_byhour_validation(): void {
197
        $rrule = "BYHOUR=23,45";
197
        $rrule = "BYHOUR=23,45";
Línea 198... Línea 198...
198
        $mang = new rrule_manager($rrule);
198
        $mang = new rrule_manager($rrule);
199
        $this->expectException('moodle_exception');
199
        $this->expectException('moodle_exception');
200
        $mang->parse_rrule();
200
        $mang->parse_rrule();
201
    }
201
    }
202
 
202
 
203
    /**
203
    /**
204
     * Test parsing of BYDAY rule.
204
     * Test parsing of BYDAY rule.
205
     */
205
     */
206
    public function test_byday_validation() {
206
    public function test_byday_validation(): void {
Línea 207... Línea 207...
207
        $rrule = "BYDAY=MO,2SE";
207
        $rrule = "BYDAY=MO,2SE";
208
        $mang = new rrule_manager($rrule);
208
        $mang = new rrule_manager($rrule);
209
        $this->expectException('moodle_exception');
209
        $this->expectException('moodle_exception');
210
        $mang->parse_rrule();
210
        $mang->parse_rrule();
211
    }
211
    }
212
 
212
 
213
    /**
213
    /**
214
     * Test parsing of BYDAY rule with prefixes.
214
     * Test parsing of BYDAY rule with prefixes.
Línea 232... Línea 232...
232
    }
232
    }
Línea 233... Línea 233...
233
 
233
 
234
    /**
234
    /**
235
     * Test parsing of BYMONTHDAY rule.
235
     * Test parsing of BYMONTHDAY rule.
236
     */
236
     */
237
    public function test_bymonthday_upper_bound_validation() {
237
    public function test_bymonthday_upper_bound_validation(): void {
238
        $rrule = "BYMONTHDAY=1,32";
238
        $rrule = "BYMONTHDAY=1,32";
239
        $mang = new rrule_manager($rrule);
239
        $mang = new rrule_manager($rrule);
240
        $this->expectException('moodle_exception');
240
        $this->expectException('moodle_exception');
241
        $mang->parse_rrule();
241
        $mang->parse_rrule();
Línea 242... Línea 242...
242
    }
242
    }
243
 
243
 
244
    /**
244
    /**
245
     * Test parsing of BYMONTHDAY rule.
245
     * Test parsing of BYMONTHDAY rule.
246
     */
246
     */
247
    public function test_bymonthday_0_validation() {
247
    public function test_bymonthday_0_validation(): void {
248
        $rrule = "BYMONTHDAY=1,0";
248
        $rrule = "BYMONTHDAY=1,0";
249
        $mang = new rrule_manager($rrule);
249
        $mang = new rrule_manager($rrule);
250
        $this->expectException('moodle_exception');
250
        $this->expectException('moodle_exception');
Línea 251... Línea 251...
251
        $mang->parse_rrule();
251
        $mang->parse_rrule();
252
    }
252
    }
253
 
253
 
254
    /**
254
    /**
255
     * Test parsing of BYMONTHDAY rule.
255
     * Test parsing of BYMONTHDAY rule.
256
     */
256
     */
257
    public function test_bymonthday_lower_bound_validation() {
257
    public function test_bymonthday_lower_bound_validation(): void {
258
        $rrule = "BYMONTHDAY=1,-31,-32";
258
        $rrule = "BYMONTHDAY=1,-31,-32";
259
        $mang = new rrule_manager($rrule);
259
        $mang = new rrule_manager($rrule);
Línea 260... Línea 260...
260
        $this->expectException('moodle_exception');
260
        $this->expectException('moodle_exception');
261
        $mang->parse_rrule();
261
        $mang->parse_rrule();
262
    }
262
    }
263
 
263
 
264
    /**
264
    /**
265
     * Test parsing of BYYEARDAY rule.
265
     * Test parsing of BYYEARDAY rule.
266
     */
266
     */
267
    public function test_byyearday_upper_bound_validation() {
267
    public function test_byyearday_upper_bound_validation(): void {
268
        $rrule = "BYYEARDAY=1,366,367";
268
        $rrule = "BYYEARDAY=1,366,367";
Línea 269... Línea 269...
269
        $mang = new rrule_manager($rrule);
269
        $mang = new rrule_manager($rrule);
270
        $this->expectException('moodle_exception');
270
        $this->expectException('moodle_exception');
271
        $mang->parse_rrule();
271
        $mang->parse_rrule();
272
    }
272
    }
273
 
273
 
274
    /**
274
    /**
275
     * Test parsing of BYYEARDAY rule.
275
     * Test parsing of BYYEARDAY rule.
276
     */
276
     */
277
    public function test_byyearday_0_validation() {
277
    public function test_byyearday_0_validation(): void {
Línea 278... Línea 278...
278
        $rrule = "BYYEARDAY=0";
278
        $rrule = "BYYEARDAY=0";
279
        $mang = new rrule_manager($rrule);
279
        $mang = new rrule_manager($rrule);
280
        $this->expectException('moodle_exception');
280
        $this->expectException('moodle_exception');
281
        $mang->parse_rrule();
281
        $mang->parse_rrule();
282
    }
282
    }
283
 
283
 
284
    /**
284
    /**
285
     * Test parsing of BYYEARDAY rule.
285
     * Test parsing of BYYEARDAY rule.
286
     */
286
     */
Línea 287... Línea 287...
287
    public function test_byyearday_lower_bound_validation() {
287
    public function test_byyearday_lower_bound_validation(): void {
288
        $rrule = "BYYEARDAY=-1,-366,-367";
288
        $rrule = "BYYEARDAY=-1,-366,-367";
289
        $mang = new rrule_manager($rrule);
289
        $mang = new rrule_manager($rrule);
290
        $this->expectException('moodle_exception');
290
        $this->expectException('moodle_exception');
291
        $mang->parse_rrule();
291
        $mang->parse_rrule();
292
    }
292
    }
293
 
293
 
294
    /**
294
    /**
295
     * Test parsing of BYWEEKNO rule.
295
     * Test parsing of BYWEEKNO rule.
Línea 296... Línea 296...
296
     */
296
     */
297
    public function test_non_yearly_freq_with_byweekno() {
297
    public function test_non_yearly_freq_with_byweekno(): void {
298
        $rrule = "BYWEEKNO=1,53";
298
        $rrule = "BYWEEKNO=1,53";
299
        $mang = new rrule_manager($rrule);
299
        $mang = new rrule_manager($rrule);
300
        $this->expectException('moodle_exception');
300
        $this->expectException('moodle_exception');
301
        $mang->parse_rrule();
301
        $mang->parse_rrule();
302
    }
302
    }
303
 
303
 
304
    /**
304
    /**
Línea 305... Línea 305...
305
     * Test parsing of BYWEEKNO rule.
305
     * Test parsing of BYWEEKNO rule.
306
     */
306
     */
307
    public function test_byweekno_upper_bound_validation() {
307
    public function test_byweekno_upper_bound_validation(): void {
308
        $rrule = "FREQ=YEARLY;BYWEEKNO=1,53,54";
308
        $rrule = "FREQ=YEARLY;BYWEEKNO=1,53,54";
309
        $mang = new rrule_manager($rrule);
309
        $mang = new rrule_manager($rrule);
310
        $this->expectException('moodle_exception');
310
        $this->expectException('moodle_exception');
311
        $mang->parse_rrule();
311
        $mang->parse_rrule();
312
    }
312
    }
313
 
313
 
Línea 314... Línea 314...
314
    /**
314
    /**
315
     * Test parsing of BYWEEKNO rule.
315
     * Test parsing of BYWEEKNO rule.
316
     */
316
     */
317
    public function test_byweekno_0_validation() {
317
    public function test_byweekno_0_validation(): void {
318
        $rrule = "FREQ=YEARLY;BYWEEKNO=0";
318
        $rrule = "FREQ=YEARLY;BYWEEKNO=0";
319
        $mang = new rrule_manager($rrule);
319
        $mang = new rrule_manager($rrule);
320
        $this->expectException('moodle_exception');
320
        $this->expectException('moodle_exception');
321
        $mang->parse_rrule();
321
        $mang->parse_rrule();
322
    }
322
    }
Línea 323... Línea 323...
323
 
323
 
324
    /**
324
    /**
325
     * Test parsing of BYWEEKNO rule.
325
     * Test parsing of BYWEEKNO rule.
326
     */
326
     */
327
    public function test_byweekno_lower_bound_validation() {
327
    public function test_byweekno_lower_bound_validation(): void {
328
        $rrule = "FREQ=YEARLY;BYWEEKNO=-1,-53,-54";
328
        $rrule = "FREQ=YEARLY;BYWEEKNO=-1,-53,-54";
329
        $mang = new rrule_manager($rrule);
329
        $mang = new rrule_manager($rrule);
330
        $this->expectException('moodle_exception');
330
        $this->expectException('moodle_exception');
331
        $mang->parse_rrule();
331
        $mang->parse_rrule();
Línea 332... Línea 332...
332
    }
332
    }
333
 
333
 
334
    /**
334
    /**
335
     * Test parsing of BYMONTH rule.
335
     * Test parsing of BYMONTH rule.
336
     */
336
     */
337
    public function test_bymonth_upper_bound_validation() {
337
    public function test_bymonth_upper_bound_validation(): void {
338
        $rrule = "BYMONTH=1,12,13";
338
        $rrule = "BYMONTH=1,12,13";
339
        $mang = new rrule_manager($rrule);
339
        $mang = new rrule_manager($rrule);
340
        $this->expectException('moodle_exception');
340
        $this->expectException('moodle_exception');
Línea 341... Línea 341...
341
        $mang->parse_rrule();
341
        $mang->parse_rrule();
342
    }
342
    }
343
 
343
 
344
    /**
344
    /**
345
     * Test parsing of BYMONTH rule.
345
     * Test parsing of BYMONTH rule.
346
     */
346
     */
347
    public function test_bymonth_lower_bound_validation() {
347
    public function test_bymonth_lower_bound_validation(): void {
348
        $rrule = "BYMONTH=0";
348
        $rrule = "BYMONTH=0";
349
        $mang = new rrule_manager($rrule);
349
        $mang = new rrule_manager($rrule);
Línea 350... Línea 350...
350
        $this->expectException('moodle_exception');
350
        $this->expectException('moodle_exception');
351
        $mang->parse_rrule();
351
        $mang->parse_rrule();
352
    }
352
    }
353
 
353
 
354
    /**
354
    /**
355
     * Test parsing of BYSETPOS rule.
355
     * Test parsing of BYSETPOS rule.
356
     */
356
     */
357
    public function test_bysetpos_without_other_byrules() {
357
    public function test_bysetpos_without_other_byrules(): void {
358
        $rrule = "BYSETPOS=1,366";
358
        $rrule = "BYSETPOS=1,366";
Línea 359... Línea 359...
359
        $mang = new rrule_manager($rrule);
359
        $mang = new rrule_manager($rrule);
360
        $this->expectException('moodle_exception');
360
        $this->expectException('moodle_exception');
361
        $mang->parse_rrule();
361
        $mang->parse_rrule();
362
    }
362
    }
363
 
363
 
364
    /**
364
    /**
365
     * Test parsing of BYSETPOS rule.
365
     * Test parsing of BYSETPOS rule.
366
     */
366
     */
367
    public function test_bysetpos_upper_bound_validation() {
367
    public function test_bysetpos_upper_bound_validation(): void {
Línea 368... Línea 368...
368
        $rrule = "BYSETPOS=1,366,367";
368
        $rrule = "BYSETPOS=1,366,367";
369
        $mang = new rrule_manager($rrule);
369
        $mang = new rrule_manager($rrule);
370
        $this->expectException('moodle_exception');
370
        $this->expectException('moodle_exception');
371
        $mang->parse_rrule();
371
        $mang->parse_rrule();
372
    }
372
    }
373
 
373
 
374
    /**
374
    /**
375
     * Test parsing of BYSETPOS rule.
375
     * Test parsing of BYSETPOS rule.
376
     */
376
     */
Línea 377... Línea 377...
377
    public function test_bysetpos_0_validation() {
377
    public function test_bysetpos_0_validation(): void {
378
        $rrule = "BYSETPOS=0";
378
        $rrule = "BYSETPOS=0";
379
        $mang = new rrule_manager($rrule);
379
        $mang = new rrule_manager($rrule);
380
        $this->expectException('moodle_exception');
380
        $this->expectException('moodle_exception');
381
        $mang->parse_rrule();
381
        $mang->parse_rrule();
Línea 382... Línea 382...
382
    }
382
    }
383
 
383
 
384
    /**
384
    /**
Línea 437... Línea 437...
437
    }
437
    }
Línea 438... Línea 438...
438
 
438
 
439
    /**
439
    /**
440
     * Every 300 days, forever.
440
     * Every 300 days, forever.
441
     */
441
     */
442
    public function test_every_300_days_forever() {
442
    public function test_every_300_days_forever(): void {
Línea 443... Línea 443...
443
        global $DB;
443
        global $DB;
444
 
444
 
445
        // Change the start date for forever events to 9am of the current date.
445
        // Change the start date for forever events to 9am of the current date.
Línea 479... Línea 479...
479
    }
479
    }
Línea 480... Línea 480...
480
 
480
 
481
    /**
481
    /**
482
     * Test recurrence rules for weekly frequency.
482
     * Test recurrence rules for weekly frequency.
483
     */
483
     */
484
    public function test_weekly_events() {
484
    public function test_weekly_events(): void {
Línea 485... Línea 485...
485
        global $DB;
485
        global $DB;
486
 
486
 
487
        $rrule = 'FREQ=WEEKLY;COUNT=1';
487
        $rrule = 'FREQ=WEEKLY;COUNT=1';
Línea 549... Línea 549...
549
    }
549
    }
Línea 550... Línea 550...
550
 
550
 
551
    /**
551
    /**
552
     * Test recurrence rules for weekly frequency for RRULE with BYDAY rule set, recurring forever.
552
     * Test recurrence rules for weekly frequency for RRULE with BYDAY rule set, recurring forever.
553
     */
553
     */
554
    public function test_weekly_byday_forever() {
554
    public function test_weekly_byday_forever(): void {
Línea 555... Línea 555...
555
        global $DB;
555
        global $DB;
556
 
556
 
557
        // Set the next Monday as the starting date of this event.
557
        // Set the next Monday as the starting date of this event.
Línea 589... Línea 589...
589
    }
589
    }
Línea 590... Línea 590...
590
 
590
 
591
    /**
591
    /**
592
     * Test recurrence rules for monthly frequency for RRULE with COUNT and BYMONTHDAY rules set.
592
     * Test recurrence rules for monthly frequency for RRULE with COUNT and BYMONTHDAY rules set.
593
     */
593
     */
594
    public function test_monthly_events_with_count_bymonthday() {
594
    public function test_monthly_events_with_count_bymonthday(): void {
Línea 595... Línea 595...
595
        global $DB;
595
        global $DB;
596
 
596
 
Línea 613... Línea 613...
613
    }
613
    }
Línea 614... Línea 614...
614
 
614
 
615
    /**
615
    /**
616
     * Test recurrence rules for monthly frequency for RRULE with BYMONTHDAY and UNTIL rules set.
616
     * Test recurrence rules for monthly frequency for RRULE with BYMONTHDAY and UNTIL rules set.
617
     */
617
     */
618
    public function test_monthly_events_with_until_bymonthday() {
618
    public function test_monthly_events_with_until_bymonthday(): void {
Línea 619... Línea 619...
619
        global $DB;
619
        global $DB;
620
 
620
 
621
        // This should generate 10 child event + 1 parent, since by then until bound would be hit.
621
        // This should generate 10 child event + 1 parent, since by then until bound would be hit.
Línea 635... Línea 635...
635
    }
635
    }
Línea 636... Línea 636...
636
 
636
 
637
    /**
637
    /**
638
     * Test recurrence rules for monthly frequency for RRULE with BYMONTHDAY and UNTIL rules set.
638
     * Test recurrence rules for monthly frequency for RRULE with BYMONTHDAY and UNTIL rules set.
639
     */
639
     */
640
    public function test_monthly_events_with_until_bymonthday_multi() {
640
    public function test_monthly_events_with_until_bymonthday_multi(): void {
Línea 641... Línea 641...
641
        global $DB;
641
        global $DB;
642
 
642
 
643
        $startdatetime = new \DateTime(date('Y-m-d H:i:s', $this->event->timestart));
643
        $startdatetime = new \DateTime(date('Y-m-d H:i:s', $this->event->timestart));
Línea 678... Línea 678...
678
    }
678
    }
Línea 679... Línea 679...
679
 
679
 
680
    /**
680
    /**
681
     * Test recurrence rules for monthly frequency for RRULE with BYMONTHDAY forever.
681
     * Test recurrence rules for monthly frequency for RRULE with BYMONTHDAY forever.
682
     */
682
     */
683
    public function test_monthly_events_with_bymonthday_forever() {
683
    public function test_monthly_events_with_bymonthday_forever(): void {
Línea 684... Línea 684...
684
        global $DB;
684
        global $DB;
685
 
685
 
686
        // Change the start date for forever events to 9am of the 2nd day of the current month and year.
686
        // Change the start date for forever events to 9am of the 2nd day of the current month and year.
Línea 721... Línea 721...
721
    }
721
    }
Línea 722... Línea 722...
722
 
722
 
723
    /**
723
    /**
724
     * Test recurrence rules for monthly frequency for RRULE with COUNT and BYDAY rules set.
724
     * Test recurrence rules for monthly frequency for RRULE with COUNT and BYDAY rules set.
725
     */
725
     */
726
    public function test_monthly_events_with_count_byday() {
726
    public function test_monthly_events_with_count_byday(): void {
Línea 727... Línea 727...
727
        global $DB;
727
        global $DB;
728
 
728
 
Línea 754... Línea 754...
754
    }
754
    }
Línea 755... Línea 755...
755
 
755
 
756
    /**
756
    /**
757
     * Test recurrence rules for monthly frequency for RRULE with BYDAY and UNTIL rules set.
757
     * Test recurrence rules for monthly frequency for RRULE with BYDAY and UNTIL rules set.
758
     */
758
     */
759
    public function test_monthly_events_with_until_byday() {
759
    public function test_monthly_events_with_until_byday(): void {
Línea 760... Línea 760...
760
        global $DB;
760
        global $DB;
761
 
761
 
762
        // This much seconds after the start of the day.
762
        // This much seconds after the start of the day.
Línea 792... Línea 792...
792
    }
792
    }
Línea 793... Línea 793...
793
 
793
 
794
    /**
794
    /**
795
     * Test recurrence rules for monthly frequency for RRULE with BYMONTHDAY and UNTIL rules set.
795
     * Test recurrence rules for monthly frequency for RRULE with BYMONTHDAY and UNTIL rules set.
796
     */
796
     */
797
    public function test_monthly_events_with_until_byday_multi() {
797
    public function test_monthly_events_with_until_byday_multi(): void {
Línea 798... Línea 798...
798
        global $DB;
798
        global $DB;
799
 
799
 
Línea 834... Línea 834...
834
    }
834
    }
Línea 835... Línea 835...
835
 
835
 
836
    /**
836
    /**
837
     * Test recurrence rules for monthly frequency for RRULE with BYDAY forever.
837
     * Test recurrence rules for monthly frequency for RRULE with BYDAY forever.
838
     */
838
     */
839
    public function test_monthly_events_with_byday_forever() {
839
    public function test_monthly_events_with_byday_forever(): void {
Línea 840... Línea 840...
840
        global $DB;
840
        global $DB;
841
 
841
 
Línea 880... Línea 880...
880
    }
880
    }
Línea 881... Línea 881...
881
 
881
 
882
    /**
882
    /**
883
     * Test recurrence rules for yearly frequency.
883
     * Test recurrence rules for yearly frequency.
884
     */
884
     */
885
    public function test_yearly_events() {
885
    public function test_yearly_events(): void {
Línea 886... Línea 886...
886
        global $DB;
886
        global $DB;
887
 
887
 
Línea 1013... Línea 1013...
1013
    }
1013
    }
Línea 1014... Línea 1014...
1014
 
1014
 
1015
    /**
1015
    /**
1016
     * Test for rrule with FREQ=YEARLY and INTERVAL=2 with BYMONTH rule set, recurring forever.
1016
     * Test for rrule with FREQ=YEARLY and INTERVAL=2 with BYMONTH rule set, recurring forever.
1017
     */
1017
     */
1018
    public function test_yearly_september_every_two_years_forever() {
1018
    public function test_yearly_september_every_two_years_forever(): void {
Línea 1019... Línea 1019...
1019
        global $DB;
1019
        global $DB;
1020
 
1020
 
Línea 1043... Línea 1043...
1043
    }
1043
    }
Línea 1044... Línea 1044...
1044
 
1044
 
1045
    /**
1045
    /**
1046
     * Test for rrule with FREQ=YEARLY with BYMONTH and BYDAY rules set, recurring forever.
1046
     * Test for rrule with FREQ=YEARLY with BYMONTH and BYDAY rules set, recurring forever.
1047
     */
1047
     */
1048
    public function test_yearly_bymonth_byday_forever() {
1048
    public function test_yearly_bymonth_byday_forever(): void {
Línea 1049... Línea 1049...
1049
        global $DB;
1049
        global $DB;
1050
 
1050
 
Línea 1086... Línea 1086...
1086
    }
1086
    }
Línea 1087... Línea 1087...
1087
 
1087
 
1088
    /**
1088
    /**
1089
     * Test for rrule with FREQ=YEARLY recurring forever.
1089
     * Test for rrule with FREQ=YEARLY recurring forever.
1090
     */
1090
     */
1091
    public function test_yearly_forever() {
1091
    public function test_yearly_forever(): void {
Línea 1092... Línea 1092...
1092
        global $DB;
1092
        global $DB;
1093
 
1093
 
Línea 1128... Línea 1128...
1128
     *
1128
     *
1129
     * DTSTART;TZID=US-Eastern:19970902T090000
1129
     * DTSTART;TZID=US-Eastern:19970902T090000
1130
     * RRULE:FREQ=DAILY;COUNT=10
1130
     * RRULE:FREQ=DAILY;COUNT=10
1131
     *   ==> (1997 9:00 AM EDT)September 2-11
1131
     *   ==> (1997 9:00 AM EDT)September 2-11
1132
     */
1132
     */
1133
    public function test_daily_count() {
1133
    public function test_daily_count(): void {
1134
        global $DB;
1134
        global $DB;
Línea 1135... Línea 1135...
1135
 
1135
 
1136
        $startdatetime = new \DateTime(date('Y-m-d H:i:s', $this->event->timestart));
1136
        $startdatetime = new \DateTime(date('Y-m-d H:i:s', $this->event->timestart));
Línea 1159... Línea 1159...
1159
     * DTSTART;TZID=US-Eastern:19970902T090000
1159
     * DTSTART;TZID=US-Eastern:19970902T090000
1160
     * RRULE:FREQ=DAILY;UNTIL=19971224T000000Z
1160
     * RRULE:FREQ=DAILY;UNTIL=19971224T000000Z
1161
     *   ==> (1997 9:00 AM EDT)September 2-30;October 1-25
1161
     *   ==> (1997 9:00 AM EDT)September 2-30;October 1-25
1162
     *       (1997 9:00 AM EST)October 26-31;November 1-30;December 1-23
1162
     *       (1997 9:00 AM EST)October 26-31;November 1-30;December 1-23
1163
     */
1163
     */
1164
    public function test_daily_until() {
1164
    public function test_daily_until(): void {
1165
        global $DB;
1165
        global $DB;
Línea 1166... Línea 1166...
1166
 
1166
 
1167
        $startdatetime = new \DateTime(date('Y-m-d H:i:s', $this->event->timestart));
1167
        $startdatetime = new \DateTime(date('Y-m-d H:i:s', $this->event->timestart));
Línea 1196... Línea 1196...
1196
     *
1196
     *
1197
     * Sample results (e.g. in the year 1997):
1197
     * Sample results (e.g. in the year 1997):
1198
     *  (1997 9:00 AM EDT)September2,4,6,8...24,26,28,30;October 2,4,6...20,22,24
1198
     *  (1997 9:00 AM EDT)September2,4,6,8...24,26,28,30;October 2,4,6...20,22,24
1199
     *  (1997 9:00 AM EST)October 26,28,30;November 1,3,5,7...25,27,29;Dec 1,3,...
1199
     *  (1997 9:00 AM EST)October 26,28,30;November 1,3,5,7...25,27,29;Dec 1,3,...
1200
     */
1200
     */
1201
    public function test_every_other_day_forever() {
1201
    public function test_every_other_day_forever(): void {
1202
        global $DB;
1202
        global $DB;
Línea 1203... Línea 1203...
1203
 
1203
 
1204
        // Change the start date for forever events to 9am of the current date in US/Eastern time.
1204
        // Change the start date for forever events to 9am of the current date in US/Eastern time.
Línea 1234... Línea 1234...
1234
     *
1234
     *
1235
     * DTSTART;TZID=US-Eastern:19970902T090000
1235
     * DTSTART;TZID=US-Eastern:19970902T090000
1236
     * RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5
1236
     * RRULE:FREQ=DAILY;INTERVAL=10;COUNT=5
1237
     *   ==> (1997 9:00 AM EDT)September 2,12,22;October 2,12
1237
     *   ==> (1997 9:00 AM EDT)September 2,12,22;October 2,12
1238
     */
1238
     */
1239
    public function test_every_10_days_5_count() {
1239
    public function test_every_10_days_5_count(): void {
1240
        global $DB;
1240
        global $DB;
Línea 1241... Línea 1241...
1241
 
1241
 
1242
        $startdatetime = new \DateTime(date('Y-m-d H:i:s', $this->event->timestart));
1242
        $startdatetime = new \DateTime(date('Y-m-d H:i:s', $this->event->timestart));
Línea 1265... Línea 1265...
1265
     * RRULE:FREQ=YEARLY;UNTIL=20000131T090000Z;BYMONTH=1;BYDAY=SU,MO,TU,WE,TH,FR,SA
1265
     * RRULE:FREQ=YEARLY;UNTIL=20000131T090000Z;BYMONTH=1;BYDAY=SU,MO,TU,WE,TH,FR,SA
1266
     *   ==> (1998 9:00 AM EDT)January 1-31
1266
     *   ==> (1998 9:00 AM EDT)January 1-31
1267
     *       (1999 9:00 AM EDT)January 1-31
1267
     *       (1999 9:00 AM EDT)January 1-31
1268
     *       (2000 9:00 AM EDT)January 1-31
1268
     *       (2000 9:00 AM EDT)January 1-31
1269
     */
1269
     */
1270
    public function test_everyday_in_jan_for_3_years_yearly() {
1270
    public function test_everyday_in_jan_for_3_years_yearly(): void {
1271
        global $DB;
1271
        global $DB;
Línea 1272... Línea 1272...
1272
 
1272
 
1273
        // Change our event's date to 01-01-1998, based on the example from the RFC.
1273
        // Change our event's date to 01-01-1998, based on the example from the RFC.
Línea 1299... Línea 1299...
1299
     * RRULE:FREQ=DAILY;UNTIL=20000131T090000Z;BYMONTH=1
1299
     * RRULE:FREQ=DAILY;UNTIL=20000131T090000Z;BYMONTH=1
1300
     *   ==> (1998 9:00 AM EDT)January 1-31
1300
     *   ==> (1998 9:00 AM EDT)January 1-31
1301
     *       (1999 9:00 AM EDT)January 1-31
1301
     *       (1999 9:00 AM EDT)January 1-31
1302
     *       (2000 9:00 AM EDT)January 1-31
1302
     *       (2000 9:00 AM EDT)January 1-31
1303
     */
1303
     */
1304
    public function test_everyday_in_jan_for_3_years_daily() {
1304
    public function test_everyday_in_jan_for_3_years_daily(): void {
1305
        global $DB;
1305
        global $DB;
Línea 1306... Línea 1306...
1306
 
1306
 
1307
        // Change our event's date to 01-01-1998, based on the example from the RFC.
1307
        // Change our event's date to 01-01-1998, based on the example from the RFC.
Línea 1332... Línea 1332...
1332
     * DTSTART;TZID=US-Eastern:19970902T090000
1332
     * DTSTART;TZID=US-Eastern:19970902T090000
1333
     * RRULE:FREQ=WEEKLY;COUNT=10
1333
     * RRULE:FREQ=WEEKLY;COUNT=10
1334
     *   ==> (1997 9:00 AM EDT)September 2,9,16,23,30;October 7,14,21
1334
     *   ==> (1997 9:00 AM EDT)September 2,9,16,23,30;October 7,14,21
1335
     *       (1997 9:00 AM EST)October 28;November 4
1335
     *       (1997 9:00 AM EST)October 28;November 4
1336
     */
1336
     */
1337
    public function test_weekly_10_count() {
1337
    public function test_weekly_10_count(): void {
1338
        global $DB;
1338
        global $DB;
Línea 1339... Línea 1339...
1339
 
1339
 
Línea 1340... Línea 1340...
1340
        $interval = new \DateInterval('P1W');
1340
        $interval = new \DateInterval('P1W');
Línea 1361... Línea 1361...
1361
     * DTSTART;TZID=US-Eastern:19970902T090000
1361
     * DTSTART;TZID=US-Eastern:19970902T090000
1362
     * RRULE:FREQ=WEEKLY;UNTIL=19971224T000000Z
1362
     * RRULE:FREQ=WEEKLY;UNTIL=19971224T000000Z
1363
     *   ==> (1997 9:00 AM EDT)September 2,9,16,23,30;October 7,14,21,28
1363
     *   ==> (1997 9:00 AM EDT)September 2,9,16,23,30;October 7,14,21,28
1364
     *       (1997 9:00 AM EST)November 4,11,18,25;December 2,9,16,23
1364
     *       (1997 9:00 AM EST)November 4,11,18,25;December 2,9,16,23
1365
     */
1365
     */
1366
    public function test_weekly_until_24_dec_1997() {
1366
    public function test_weekly_until_24_dec_1997(): void {
1367
        global $DB;
1367
        global $DB;
Línea 1368... Línea 1368...
1368
 
1368
 
Línea 1369... Línea 1369...
1369
        $interval = new \DateInterval('P1W');
1369
        $interval = new \DateInterval('P1W');
Línea 1398... Línea 1398...
1398
     *  (1997 9:00 AM EDT)September 2,16,30;October 14
1398
     *  (1997 9:00 AM EDT)September 2,16,30;October 14
1399
     *  (1997 9:00 AM EST)October 28;November 11,25;December 9,23
1399
     *  (1997 9:00 AM EST)October 28;November 11,25;December 9,23
1400
     *  (1998 9:00 AM EST)January 6,20;February
1400
     *  (1998 9:00 AM EST)January 6,20;February
1401
     *  ...
1401
     *  ...
1402
     */
1402
     */
1403
    public function test_every_other_week_forever() {
1403
    public function test_every_other_week_forever(): void {
1404
        global $DB;
1404
        global $DB;
Línea 1405... Línea 1405...
1405
 
1405
 
1406
        // Change the start date for forever events to 9am of the current date in US/Eastern time.
1406
        // Change the start date for forever events to 9am of the current date in US/Eastern time.
Línea 1435... Línea 1435...
1435
     *
1435
     *
1436
     * DTSTART;TZID=US-Eastern:19970902T090000
1436
     * DTSTART;TZID=US-Eastern:19970902T090000
1437
     * RRULE:FREQ=WEEKLY;UNTIL=19971007T000000Z;WKST=SU;BYDAY=TU,TH
1437
     * RRULE:FREQ=WEEKLY;UNTIL=19971007T000000Z;WKST=SU;BYDAY=TU,TH
1438
     *   ==> (1997 9:00 AM EDT)September 2,4,9,11,16,18,23,25,30;October 2
1438
     *   ==> (1997 9:00 AM EDT)September 2,4,9,11,16,18,23,25,30;October 2
1439
     */
1439
     */
1440
    public function test_weekly_on_tue_thu_for_5_weeks_by_until() {
1440
    public function test_weekly_on_tue_thu_for_5_weeks_by_until(): void {
1441
        global $DB;
1441
        global $DB;
Línea 1442... Línea 1442...
1442
 
1442
 
1443
        $rrule = 'FREQ=WEEKLY;UNTIL=19971007T000000Z;WKST=SU;BYDAY=TU,TH';
1443
        $rrule = 'FREQ=WEEKLY;UNTIL=19971007T000000Z;WKST=SU;BYDAY=TU,TH';
1444
        $mang = new rrule_manager($rrule);
1444
        $mang = new rrule_manager($rrule);
Línea 1473... Línea 1473...
1473
     *
1473
     *
1474
     * DTSTART;TZID=US-Eastern:19970902T090000
1474
     * DTSTART;TZID=US-Eastern:19970902T090000
1475
     * RRULE:FREQ=WEEKLY;COUNT=10;WKST=SU;BYDAY=TU,TH
1475
     * RRULE:FREQ=WEEKLY;COUNT=10;WKST=SU;BYDAY=TU,TH
1476
     *   ==> (1997 9:00 AM EDT)September 2,4,9,11,16,18,23,25,30;October 2
1476
     *   ==> (1997 9:00 AM EDT)September 2,4,9,11,16,18,23,25,30;October 2
1477
     */
1477
     */
1478
    public function test_weekly_on_tue_thu_for_5_weeks_by_count() {
1478
    public function test_weekly_on_tue_thu_for_5_weeks_by_count(): void {
1479
        global $DB;
1479
        global $DB;
Línea 1480... Línea 1480...
1480
 
1480
 
1481
        $rrule = 'FREQ=WEEKLY;COUNT=10;WKST=SU;BYDAY=TU,TH';
1481
        $rrule = 'FREQ=WEEKLY;COUNT=10;WKST=SU;BYDAY=TU,TH';
1482
        $mang = new rrule_manager($rrule);
1482
        $mang = new rrule_manager($rrule);
Línea 1508... Línea 1508...
1508
     * DTSTART;TZID=US-Eastern:19970902T090000
1508
     * DTSTART;TZID=US-Eastern:19970902T090000
1509
     * RRULE:FREQ=WEEKLY;INTERVAL=2;UNTIL=19971224T000000Z;WKST=SU;BYDAY=MO,WE,FR
1509
     * RRULE:FREQ=WEEKLY;INTERVAL=2;UNTIL=19971224T000000Z;WKST=SU;BYDAY=MO,WE,FR
1510
     *   ==> (1997 9:00 AM EDT)September 3,5,15,17,19,29;October 1,3,13,15,17
1510
     *   ==> (1997 9:00 AM EDT)September 3,5,15,17,19,29;October 1,3,13,15,17
1511
     *       (1997 9:00 AM EST)October 27,29,31;November 10,12,14,24,26,28;December 8,10,12,22
1511
     *       (1997 9:00 AM EST)October 27,29,31;November 10,12,14,24,26,28;December 8,10,12,22
1512
     */
1512
     */
1513
    public function test_every_other_week_until_24_dec_1997_byday() {
1513
    public function test_every_other_week_until_24_dec_1997_byday(): void {
1514
        global $DB;
1514
        global $DB;
Línea 1515... Línea 1515...
1515
 
1515
 
1516
        $rrule = 'FREQ=WEEKLY;INTERVAL=2;UNTIL=19971224T000000Z;WKST=SU;BYDAY=MO,WE,FR';
1516
        $rrule = 'FREQ=WEEKLY;INTERVAL=2;UNTIL=19971224T000000Z;WKST=SU;BYDAY=MO,WE,FR';
1517
        $mang = new rrule_manager($rrule);
1517
        $mang = new rrule_manager($rrule);
Línea 1561... Línea 1561...
1561
     *
1561
     *
1562
     * DTSTART;TZID=US-Eastern:19970902T090000
1562
     * DTSTART;TZID=US-Eastern:19970902T090000
1563
     * RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=8;WKST=SU;BYDAY=TU,TH
1563
     * RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=8;WKST=SU;BYDAY=TU,TH
1564
     *   ==> (1997 9:00 AM EDT)September 2,4,16,18,30;October 2,14,16
1564
     *   ==> (1997 9:00 AM EDT)September 2,4,16,18,30;October 2,14,16
1565
     */
1565
     */
1566
    public function test_every_other_week_byday_8_count() {
1566
    public function test_every_other_week_byday_8_count(): void {
1567
        global $DB;
1567
        global $DB;
Línea 1568... Línea 1568...
1568
 
1568
 
1569
        $rrule = 'FREQ=WEEKLY;INTERVAL=2;COUNT=8;WKST=SU;BYDAY=TU,TH';
1569
        $rrule = 'FREQ=WEEKLY;INTERVAL=2;COUNT=8;WKST=SU;BYDAY=TU,TH';
1570
        $mang = new rrule_manager($rrule);
1570
        $mang = new rrule_manager($rrule);
Línea 1608... Línea 1608...
1608
     *   ==> (1997 9:00 AM EDT)September 5;October 3
1608
     *   ==> (1997 9:00 AM EDT)September 5;October 3
1609
     *       (1997 9:00 AM EST)November 7;Dec 5
1609
     *       (1997 9:00 AM EST)November 7;Dec 5
1610
     *       (1998 9:00 AM EST)January 2;February 6;March 6;April 3
1610
     *       (1998 9:00 AM EST)January 2;February 6;March 6;April 3
1611
     *       (1998 9:00 AM EDT)May 1;June 5
1611
     *       (1998 9:00 AM EDT)May 1;June 5
1612
     */
1612
     */
1613
    public function test_monthly_every_first_friday_10_count() {
1613
    public function test_monthly_every_first_friday_10_count(): void {
1614
        global $DB;
1614
        global $DB;
Línea 1615... Línea 1615...
1615
 
1615
 
1616
        // Change our event's date to 05-09-1997, based on the example from the RFC.
1616
        // Change our event's date to 05-09-1997, based on the example from the RFC.
1617
        $startdatetime = $this->change_event_startdate('19970905T090000', 'US/Eastern');
1617
        $startdatetime = $this->change_event_startdate('19970905T090000', 'US/Eastern');
Línea 1644... Línea 1644...
1644
     * DTSTART;TZID=US-Eastern:19970905T090000
1644
     * DTSTART;TZID=US-Eastern:19970905T090000
1645
     * RRULE:FREQ=MONTHLY;UNTIL=19971224T000000Z;BYDAY=1FR
1645
     * RRULE:FREQ=MONTHLY;UNTIL=19971224T000000Z;BYDAY=1FR
1646
     *   ==> (1997 9:00 AM EDT)September 5;October 3
1646
     *   ==> (1997 9:00 AM EDT)September 5;October 3
1647
     *       (1997 9:00 AM EST)November 7;December 5
1647
     *       (1997 9:00 AM EST)November 7;December 5
1648
     */
1648
     */
1649
    public function test_monthly_every_first_friday_until() {
1649
    public function test_monthly_every_first_friday_until(): void {
1650
        global $DB;
1650
        global $DB;
Línea 1651... Línea 1651...
1651
 
1651
 
1652
        // Change our event's date to 05-09-1997, based on the example from the RFC.
1652
        // Change our event's date to 05-09-1997, based on the example from the RFC.
1653
        $startdatetime = $this->change_event_startdate('19970905T090000', 'US/Eastern');
1653
        $startdatetime = $this->change_event_startdate('19970905T090000', 'US/Eastern');
Línea 1682... Línea 1682...
1682
     *   ==> (1997 9:00 AM EDT)September 7,28
1682
     *   ==> (1997 9:00 AM EDT)September 7,28
1683
     *       (1997 9:00 AM EST)November 2,30
1683
     *       (1997 9:00 AM EST)November 2,30
1684
     *       (1998 9:00 AM EST)January 4,25;March 1,29
1684
     *       (1998 9:00 AM EST)January 4,25;March 1,29
1685
     *       (1998 9:00 AM EDT)May 3,31
1685
     *       (1998 9:00 AM EDT)May 3,31
1686
     */
1686
     */
1687
    public function test_every_other_month_1st_and_last_sunday_10_count() {
1687
    public function test_every_other_month_1st_and_last_sunday_10_count(): void {
1688
        global $DB;
1688
        global $DB;
Línea 1689... Línea 1689...
1689
 
1689
 
1690
        // Change our event's date to 05-09-1997, based on the example from the RFC.
1690
        // Change our event's date to 05-09-1997, based on the example from the RFC.
1691
        $startdatetime = $this->change_event_startdate('19970907T090000', 'US/Eastern');
1691
        $startdatetime = $this->change_event_startdate('19970907T090000', 'US/Eastern');
Línea 1725... Línea 1725...
1725
     * RRULE:FREQ=MONTHLY;COUNT=6;BYDAY=-2MO
1725
     * RRULE:FREQ=MONTHLY;COUNT=6;BYDAY=-2MO
1726
     *   ==> (1997 9:00 AM EDT)September 22;October 20
1726
     *   ==> (1997 9:00 AM EDT)September 22;October 20
1727
     *       (1997 9:00 AM EST)November 17;December 22
1727
     *       (1997 9:00 AM EST)November 17;December 22
1728
     *       (1998 9:00 AM EST)January 19;February 16
1728
     *       (1998 9:00 AM EST)January 19;February 16
1729
     */
1729
     */
1730
    public function test_monthly_last_monday_for_6_months() {
1730
    public function test_monthly_last_monday_for_6_months(): void {
1731
        global $DB;
1731
        global $DB;
Línea 1732... Línea 1732...
1732
 
1732
 
1733
        // Change our event's date to 05-09-1997, based on the example from the RFC.
1733
        // Change our event's date to 05-09-1997, based on the example from the RFC.
1734
        $startdatetime = $this->change_event_startdate('19970922T090000', 'US/Eastern');
1734
        $startdatetime = $this->change_event_startdate('19970922T090000', 'US/Eastern');
Línea 1767... Línea 1767...
1767
     *  (1997 9:00 AM EDT)September 28
1767
     *  (1997 9:00 AM EDT)September 28
1768
     *  (1997 9:00 AM EST)October 29;November 28;December 29
1768
     *  (1997 9:00 AM EST)October 29;November 28;December 29
1769
     *  (1998 9:00 AM EST)January 29;February 26
1769
     *  (1998 9:00 AM EST)January 29;February 26
1770
     *  ...
1770
     *  ...
1771
     */
1771
     */
1772
    public function test_third_to_the_last_day_of_the_month_forever() {
1772
    public function test_third_to_the_last_day_of_the_month_forever(): void {
1773
        global $DB;
1773
        global $DB;
Línea 1774... Línea 1774...
1774
 
1774
 
1775
        // Change our event's date to 28 September of the current year, based on the example from the RFC.
1775
        // Change our event's date to 28 September of the current year, based on the example from the RFC.
Línea 1810... Línea 1810...
1810
     * RRULE:FREQ=MONTHLY;COUNT=10;BYMONTHDAY=2,15
1810
     * RRULE:FREQ=MONTHLY;COUNT=10;BYMONTHDAY=2,15
1811
     *   ==> (1997 9:00 AM EDT)September 2,15;October 2,15
1811
     *   ==> (1997 9:00 AM EDT)September 2,15;October 2,15
1812
     *       (1997 9:00 AM EST)November 2,15;December 2,15
1812
     *       (1997 9:00 AM EST)November 2,15;December 2,15
1813
     *       (1998 9:00 AM EST)January 2,15
1813
     *       (1998 9:00 AM EST)January 2,15
1814
     */
1814
     */
1815
    public function test_every_2nd_and_15th_of_the_month_10_count() {
1815
    public function test_every_2nd_and_15th_of_the_month_10_count(): void {
1816
        global $DB;
1816
        global $DB;
Línea 1817... Línea 1817...
1817
 
1817
 
1818
        $startdatetime = new \DateTime(date('Y-m-d H:i:s', $this->event->timestart));
1818
        $startdatetime = new \DateTime(date('Y-m-d H:i:s', $this->event->timestart));
1819
        $startdate = new \DateTime($startdatetime->format('Y-m-d'));
1819
        $startdate = new \DateTime($startdatetime->format('Y-m-d'));
Línea 1854... Línea 1854...
1854
     * RRULE:FREQ=MONTHLY;COUNT=10;BYMONTHDAY=1,-1
1854
     * RRULE:FREQ=MONTHLY;COUNT=10;BYMONTHDAY=1,-1
1855
     *   ==> (1997 9:00 AM EDT)September 30;October 1
1855
     *   ==> (1997 9:00 AM EDT)September 30;October 1
1856
     *       (1997 9:00 AM EST)October 31;November 1,30;December 1,31
1856
     *       (1997 9:00 AM EST)October 31;November 1,30;December 1,31
1857
     *       (1998 9:00 AM EST)January 1,31;February 1
1857
     *       (1998 9:00 AM EST)January 1,31;February 1
1858
     */
1858
     */
1859
    public function test_every_first_and_last_day_of_the_month_10_count() {
1859
    public function test_every_first_and_last_day_of_the_month_10_count(): void {
1860
        global $DB;
1860
        global $DB;
Línea 1861... Línea 1861...
1861
 
1861
 
1862
        $startdatetime = $this->change_event_startdate('19970930T090000', 'US/Eastern');
1862
        $startdatetime = $this->change_event_startdate('19970930T090000', 'US/Eastern');
1863
        $startdate = new \DateTime($startdatetime->format('Y-m-d'));
1863
        $startdate = new \DateTime($startdatetime->format('Y-m-d'));
Línea 1899... Línea 1899...
1899
     * DTSTART;TZID=US-Eastern:19970910T090000
1899
     * DTSTART;TZID=US-Eastern:19970910T090000
1900
     * RRULE:FREQ=MONTHLY;INTERVAL=18;COUNT=10;BYMONTHDAY=10,11,12,13,14,15
1900
     * RRULE:FREQ=MONTHLY;INTERVAL=18;COUNT=10;BYMONTHDAY=10,11,12,13,14,15
1901
     *   ==> (1997 9:00 AM EDT)September 10,11,12,13,14,15
1901
     *   ==> (1997 9:00 AM EDT)September 10,11,12,13,14,15
1902
     *       (1999 9:00 AM EST)March 10,11,12,13
1902
     *       (1999 9:00 AM EST)March 10,11,12,13
1903
     */
1903
     */
1904
    public function test_every_18_months_days_10_to_15_10_count() {
1904
    public function test_every_18_months_days_10_to_15_10_count(): void {
1905
        global $DB;
1905
        global $DB;
Línea 1906... Línea 1906...
1906
 
1906
 
Línea 1907... Línea 1907...
1907
        $startdatetime = $this->change_event_startdate('19970910T090000', 'US/Eastern');
1907
        $startdatetime = $this->change_event_startdate('19970910T090000', 'US/Eastern');
Línea 1944... Línea 1944...
1944
     *  (1997 9:00 AM EDT)September 2,9,16,23,30
1944
     *  (1997 9:00 AM EDT)September 2,9,16,23,30
1945
     *  (1997 9:00 AM EST)November 4,11,18,25
1945
     *  (1997 9:00 AM EST)November 4,11,18,25
1946
     *  (1998 9:00 AM EST)January 6,13,20,27;March 3,10,17,24,31
1946
     *  (1998 9:00 AM EST)January 6,13,20,27;March 3,10,17,24,31
1947
     *  ...
1947
     *  ...
1948
     */
1948
     */
1949
    public function test_every_tuesday_every_other_month_forever() {
1949
    public function test_every_tuesday_every_other_month_forever(): void {
1950
        global $DB;
1950
        global $DB;
Línea 1951... Línea 1951...
1951
 
1951
 
1952
        // Change the start date for forever events to 9am of the Tuesday on or before of the current date in US/Eastern time.
1952
        // Change the start date for forever events to 9am of the Tuesday on or before of the current date in US/Eastern time.
1953
        $nexttuesday = new \DateTime('next Tuesday');
1953
        $nexttuesday = new \DateTime('next Tuesday');
Línea 1999... Línea 1999...
1999
     *       (1999 9:00 AM EDT)June 10;July 10
1999
     *       (1999 9:00 AM EDT)June 10;July 10
2000
     *       (2000 9:00 AM EDT)June 10;July 10
2000
     *       (2000 9:00 AM EDT)June 10;July 10
2001
     *       (2001 9:00 AM EDT)June 10;July 10
2001
     *       (2001 9:00 AM EDT)June 10;July 10
2002
     * Note: Since none of the BYDAY, BYMONTHDAY or BYYEARDAY components are specified, the day is gotten from DTSTART.
2002
     * Note: Since none of the BYDAY, BYMONTHDAY or BYYEARDAY components are specified, the day is gotten from DTSTART.
2003
     */
2003
     */
2004
    public function test_yearly_in_june_july_10_count() {
2004
    public function test_yearly_in_june_july_10_count(): void {
2005
        global $DB;
2005
        global $DB;
Línea 2006... Línea 2006...
2006
 
2006
 
Línea 2007... Línea 2007...
2007
        $startdatetime = $this->change_event_startdate('19970610T090000', 'US/Eastern');
2007
        $startdatetime = $this->change_event_startdate('19970610T090000', 'US/Eastern');
Línea 2042... Línea 2042...
2042
     *   ==> (1997 9:00 AM EST)March 10
2042
     *   ==> (1997 9:00 AM EST)March 10
2043
     *       (1999 9:00 AM EST)January 10;February 10;March 10
2043
     *       (1999 9:00 AM EST)January 10;February 10;March 10
2044
     *       (2001 9:00 AM EST)January 10;February 10;March 10
2044
     *       (2001 9:00 AM EST)January 10;February 10;March 10
2045
     *       (2003 9:00 AM EST)January 10;February 10;March 10
2045
     *       (2003 9:00 AM EST)January 10;February 10;March 10
2046
     */
2046
     */
2047
    public function test_every_other_year_in_june_july_10_count() {
2047
    public function test_every_other_year_in_june_july_10_count(): void {
2048
        global $DB;
2048
        global $DB;
Línea 2049... Línea 2049...
2049
 
2049
 
Línea 2050... Línea 2050...
2050
        $startdatetime = $this->change_event_startdate('19970310T090000', 'US/Eastern');
2050
        $startdatetime = $this->change_event_startdate('19970310T090000', 'US/Eastern');
Línea 2089... Línea 2089...
2089
     *       (2000 9:00 AM EDT)April 9;July 18
2089
     *       (2000 9:00 AM EDT)April 9;July 18
2090
     *       (2003 9:00 AM EST)January 1
2090
     *       (2003 9:00 AM EST)January 1
2091
     *       (2003 9:00 AM EDT)April 10;July 19
2091
     *       (2003 9:00 AM EDT)April 10;July 19
2092
     *       (2006 9:00 AM EST)January 1
2092
     *       (2006 9:00 AM EST)January 1
2093
     */
2093
     */
2094
    public function test_every_3_years_1st_100th_200th_days_10_count() {
2094
    public function test_every_3_years_1st_100th_200th_days_10_count(): void {
2095
        global $DB;
2095
        global $DB;
Línea 2096... Línea 2096...
2096
 
2096
 
Línea 2097... Línea 2097...
2097
        $startdatetime = $this->change_event_startdate('19970101T090000', 'US/Eastern');
2097
        $startdatetime = $this->change_event_startdate('19970101T090000', 'US/Eastern');
Línea 2136... Línea 2136...
2136
     *  (1997 9:00 AM EDT)May 19
2136
     *  (1997 9:00 AM EDT)May 19
2137
     *  (1998 9:00 AM EDT)May 18
2137
     *  (1998 9:00 AM EDT)May 18
2138
     *  (1999 9:00 AM EDT)May 17
2138
     *  (1999 9:00 AM EDT)May 17
2139
     *  ...
2139
     *  ...
2140
     */
2140
     */
2141
    public function test_yearly_every_20th_monday_forever() {
2141
    public function test_yearly_every_20th_monday_forever(): void {
2142
        global $DB;
2142
        global $DB;
Línea 2143... Línea 2143...
2143
 
2143
 
2144
        // Change our event's date to the 20th Monday of the current year.
2144
        // Change our event's date to the 20th Monday of the current year.
2145
        $twentiethmonday = new \DateTime(date('Y-01-01'));
2145
        $twentiethmonday = new \DateTime(date('Y-01-01'));
Línea 2182... Línea 2182...
2182
     *  (1997 9:00 AM EDT)May 12
2182
     *  (1997 9:00 AM EDT)May 12
2183
     *  (1998 9:00 AM EDT)May 11
2183
     *  (1998 9:00 AM EDT)May 11
2184
     *  (1999 9:00 AM EDT)May 17
2184
     *  (1999 9:00 AM EDT)May 17
2185
     *  ...
2185
     *  ...
2186
     */
2186
     */
2187
    public function test_yearly_byweekno_forever() {
2187
    public function test_yearly_byweekno_forever(): void {
2188
        global $DB;
2188
        global $DB;
Línea 2189... Línea 2189...
2189
 
2189
 
2190
        // Change our event's date to the start of the 20th week of the current year.
2190
        // Change our event's date to the start of the 20th week of the current year.
2191
        $twentiethweek = new \DateTime(date('Y-01-01'));
2191
        $twentiethweek = new \DateTime(date('Y-01-01'));
Línea 2232... Línea 2232...
2232
     *  (1997 9:00 AM EST)March 13,20,27
2232
     *  (1997 9:00 AM EST)March 13,20,27
2233
     *  (1998 9:00 AM EST)March 5,12,19,26
2233
     *  (1998 9:00 AM EST)March 5,12,19,26
2234
     *  (1999 9:00 AM EST)March 4,11,18,25
2234
     *  (1999 9:00 AM EST)March 4,11,18,25
2235
     *  ...
2235
     *  ...
2236
     */
2236
     */
2237
    public function test_every_thursday_in_march_forever() {
2237
    public function test_every_thursday_in_march_forever(): void {
2238
        global $DB;
2238
        global $DB;
Línea 2239... Línea 2239...
2239
 
2239
 
2240
        // Change our event's date to the first Thursday of March of the current year at 9am US/Eastern time.
2240
        // Change our event's date to the first Thursday of March of the current year at 9am US/Eastern time.
2241
        $firstthursdayofmarch = new \DateTime('first Thursday of March');
2241
        $firstthursdayofmarch = new \DateTime('first Thursday of March');
Línea 2291... Línea 2291...
2291
     *  (1997 9:00 AM EDT)June 5,12,19,26;July 3,10,17,24,31;August 7,14,21,28
2291
     *  (1997 9:00 AM EDT)June 5,12,19,26;July 3,10,17,24,31;August 7,14,21,28
2292
     *  (1998 9:00 AM EDT)June 4,11,18,25;July 2,9,16,23,30;August 6,13,20,27
2292
     *  (1998 9:00 AM EDT)June 4,11,18,25;July 2,9,16,23,30;August 6,13,20,27
2293
     *  (1999 9:00 AM EDT)June 3,10,17,24;July 1,8,15,22,29;August 5,12,19,26
2293
     *  (1999 9:00 AM EDT)June 3,10,17,24;July 1,8,15,22,29;August 5,12,19,26
2294
     *  ...
2294
     *  ...
2295
     */
2295
     */
2296
    public function test_every_thursday_june_july_august_forever() {
2296
    public function test_every_thursday_june_july_august_forever(): void {
2297
        global $DB;
2297
        global $DB;
Línea 2298... Línea 2298...
2298
 
2298
 
2299
        // Change our event's date to the first Thursday of June in the current year at 9am US/Eastern time.
2299
        // Change our event's date to the first Thursday of June in the current year at 9am US/Eastern time.
2300
        $firstthursdayofjune = new \DateTime('first Thursday of June');
2300
        $firstthursdayofjune = new \DateTime('first Thursday of June');
Línea 2348... Línea 2348...
2348
     *  (1998 9:00 AM EST)February 13;March 13;November 13
2348
     *  (1998 9:00 AM EST)February 13;March 13;November 13
2349
     *  (1999 9:00 AM EDT)August 13
2349
     *  (1999 9:00 AM EDT)August 13
2350
     *  (2000 9:00 AM EDT)October 13
2350
     *  (2000 9:00 AM EDT)October 13
2351
     *  ...
2351
     *  ...
2352
     */
2352
     */
2353
    public function test_friday_the_thirteenth_forever() {
2353
    public function test_friday_the_thirteenth_forever(): void {
2354
        global $DB;
2354
        global $DB;
Línea 2355... Línea 2355...
2355
 
2355
 
2356
        // Change our event's date to the first Thursday of June in the current year at 9am US/Eastern time.
2356
        // Change our event's date to the first Thursday of June in the current year at 9am US/Eastern time.
Línea 2385... Línea 2385...
2385
     *  (1997 9:00 AM EDT)September 13;October 11
2385
     *  (1997 9:00 AM EDT)September 13;October 11
2386
     *  (1997 9:00 AM EST)November 8;December 13
2386
     *  (1997 9:00 AM EST)November 8;December 13
2387
     *  (1998 9:00 AM EST)January 10;February 7;March 7
2387
     *  (1998 9:00 AM EST)January 10;February 7;March 7
2388
     *  (1998 9:00 AM EDT)April 11;May 9;June 13...
2388
     *  (1998 9:00 AM EDT)April 11;May 9;June 13...
2389
     */
2389
     */
2390
    public function test_first_saturday_following_first_sunday_forever() {
2390
    public function test_first_saturday_following_first_sunday_forever(): void {
2391
        global $DB;
2391
        global $DB;
Línea 2392... Línea 2392...
2392
 
2392
 
2393
        // Change our event's date to the next Saturday after the first Sunday of the the current month at 9am US/Eastern time.
2393
        // Change our event's date to the next Saturday after the first Sunday of the the current month at 9am US/Eastern time.
2394
        $firstsaturdayafterfirstsunday = new \DateTime('first Sunday of this month');
2394
        $firstsaturdayafterfirstsunday = new \DateTime('first Sunday of this month');
Línea 2436... Línea 2436...
2436
     *  (1996 9:00 AM EST)November 5
2436
     *  (1996 9:00 AM EST)November 5
2437
     *  (2000 9:00 AM EST)November 7
2437
     *  (2000 9:00 AM EST)November 7
2438
     *  (2004 9:00 AM EST)November 2
2438
     *  (2004 9:00 AM EST)November 2
2439
     *  ...
2439
     *  ...
2440
     */
2440
     */
2441
    public function test_every_us_presidential_election_forever() {
2441
    public function test_every_us_presidential_election_forever(): void {
2442
        global $DB;
2442
        global $DB;
Línea 2443... Línea 2443...
2443
 
2443
 
2444
        // Calculate the most recent election date, starting from 1996 (e.g. today's 2017 so the most recent election was in 2016).
2444
        // Calculate the most recent election date, starting from 1996 (e.g. today's 2017 so the most recent election was in 2016).
2445
        $currentyear = (int) date('Y');
2445
        $currentyear = (int) date('Y');
Línea 2489... Línea 2489...
2489
     * DTSTART;TZID=US-Eastern:19970904T090000
2489
     * DTSTART;TZID=US-Eastern:19970904T090000
2490
     * RRULE:FREQ=MONTHLY;COUNT=3;BYDAY=TU,WE,TH;BYSETPOS=3
2490
     * RRULE:FREQ=MONTHLY;COUNT=3;BYDAY=TU,WE,TH;BYSETPOS=3
2491
     *   ==> (1997 9:00 AM EDT)September 4;October 7
2491
     *   ==> (1997 9:00 AM EDT)September 4;October 7
2492
     *       (1997 9:00 AM EST)November 6
2492
     *       (1997 9:00 AM EST)November 6
2493
     */
2493
     */
2494
    public function test_monthly_bysetpos_3_count() {
2494
    public function test_monthly_bysetpos_3_count(): void {
2495
        global $DB;
2495
        global $DB;
Línea 2496... Línea 2496...
2496
 
2496
 
Línea 2497... Línea 2497...
2497
        $this->change_event_startdate('19970904T090000', 'US/Eastern');
2497
        $this->change_event_startdate('19970904T090000', 'US/Eastern');
Línea 2526... Línea 2526...
2526
     *       ...
2526
     *       ...
2527
     *
2527
     *
2528
     * (Original RFC example is set to recur forever. But we just want to verify that the results match the dates listed from
2528
     * (Original RFC example is set to recur forever. But we just want to verify that the results match the dates listed from
2529
     * the RFC example. So just limit the count to 7.)
2529
     * the RFC example. So just limit the count to 7.)
2530
     */
2530
     */
2531
    public function test_second_to_the_last_weekday_of_the_month() {
2531
    public function test_second_to_the_last_weekday_of_the_month(): void {
2532
        global $DB;
2532
        global $DB;
Línea 2533... Línea 2533...
2533
 
2533
 
Línea 2534... Línea 2534...
2534
        $this->change_event_startdate('19970929T090000', 'US/Eastern');
2534
        $this->change_event_startdate('19970929T090000', 'US/Eastern');
Línea 2570... Línea 2570...
2570
     *
2570
     *
2571
     * DTSTART;TZID=US-Eastern:19970902T090000
2571
     * DTSTART;TZID=US-Eastern:19970902T090000
2572
     * RRULE:FREQ=HOURLY;INTERVAL=3;UNTIL=19970902T210000Z
2572
     * RRULE:FREQ=HOURLY;INTERVAL=3;UNTIL=19970902T210000Z
2573
     *   ==> (September 2, 1997 EDT)09:00,12:00,15:00
2573
     *   ==> (September 2, 1997 EDT)09:00,12:00,15:00
2574
     */
2574
     */
2575
    public function test_every_3hours_9am_to_5pm() {
2575
    public function test_every_3hours_9am_to_5pm(): void {
2576
        global $DB;
2576
        global $DB;
Línea 2577... Línea 2577...
2577
 
2577
 
2578
        $rrule = 'FREQ=HOURLY;INTERVAL=3;UNTIL=19970902T210000Z';
2578
        $rrule = 'FREQ=HOURLY;INTERVAL=3;UNTIL=19970902T210000Z';
2579
        $mang = new rrule_manager($rrule);
2579
        $mang = new rrule_manager($rrule);
Línea 2599... Línea 2599...
2599
     *
2599
     *
2600
     * DTSTART;TZID=US-Eastern:19970902T090000
2600
     * DTSTART;TZID=US-Eastern:19970902T090000
2601
     * RRULE:FREQ=MINUTELY;INTERVAL=15;COUNT=6
2601
     * RRULE:FREQ=MINUTELY;INTERVAL=15;COUNT=6
2602
     *   ==> (September 2, 1997 EDT)09:00,09:15,09:30,09:45,10:00,10:15
2602
     *   ==> (September 2, 1997 EDT)09:00,09:15,09:30,09:45,10:00,10:15
2603
     */
2603
     */
2604
    public function test_every_15minutes_6_count() {
2604
    public function test_every_15minutes_6_count(): void {
2605
        global $DB;
2605
        global $DB;
Línea 2606... Línea 2606...
2606
 
2606
 
2607
        $rrule = 'FREQ=MINUTELY;INTERVAL=15;COUNT=6';
2607
        $rrule = 'FREQ=MINUTELY;INTERVAL=15;COUNT=6';
2608
        $mang = new rrule_manager($rrule);
2608
        $mang = new rrule_manager($rrule);
Línea 2631... Línea 2631...
2631
     *
2631
     *
2632
     * DTSTART;TZID=US-Eastern:19970902T090000
2632
     * DTSTART;TZID=US-Eastern:19970902T090000
2633
     * RRULE:FREQ=MINUTELY;INTERVAL=90;COUNT=4
2633
     * RRULE:FREQ=MINUTELY;INTERVAL=90;COUNT=4
2634
     *   ==> (September 2, 1997 EDT)09:00,10:30;12:00;13:30
2634
     *   ==> (September 2, 1997 EDT)09:00,10:30;12:00;13:30
2635
     */
2635
     */
2636
    public function test_every_90minutes_4_count() {
2636
    public function test_every_90minutes_4_count(): void {
2637
        global $DB;
2637
        global $DB;
Línea 2638... Línea 2638...
2638
 
2638
 
2639
        $rrule = 'FREQ=MINUTELY;INTERVAL=90;COUNT=4';
2639
        $rrule = 'FREQ=MINUTELY;INTERVAL=90;COUNT=4';
2640
        $mang = new rrule_manager($rrule);
2640
        $mang = new rrule_manager($rrule);
Línea 2666... Línea 2666...
2666
     * RRULE:FREQ=DAILY;BYHOUR=9,10,11,12,13,14,15,16;BYMINUTE=0,20,40;COUNT=50
2666
     * RRULE:FREQ=DAILY;BYHOUR=9,10,11,12,13,14,15,16;BYMINUTE=0,20,40;COUNT=50
2667
     *   ==> (September 2, 1997 EDT)9:00,9:20,9:40,10:00,10:20,...16:00,16:20,16:40
2667
     *   ==> (September 2, 1997 EDT)9:00,9:20,9:40,10:00,10:20,...16:00,16:20,16:40
2668
     *       (September 3, 1997 EDT)9:00,9:20,9:40,10:00,10:20,...16:00,16:20,16:40
2668
     *       (September 3, 1997 EDT)9:00,9:20,9:40,10:00,10:20,...16:00,16:20,16:40
2669
     *       ...
2669
     *       ...
2670
     */
2670
     */
2671
    public function test_every_20minutes_daily_byhour_byminute_50_count() {
2671
    public function test_every_20minutes_daily_byhour_byminute_50_count(): void {
2672
        global $DB;
2672
        global $DB;
Línea 2673... Línea 2673...
2673
 
2673
 
2674
        $rrule = 'FREQ=DAILY;BYHOUR=9,10,11,12,13,14,15,16;BYMINUTE=0,20,40;COUNT=50';
2674
        $rrule = 'FREQ=DAILY;BYHOUR=9,10,11,12,13,14,15,16;BYMINUTE=0,20,40;COUNT=50';
2675
        $mang = new rrule_manager($rrule);
2675
        $mang = new rrule_manager($rrule);
Línea 2711... Línea 2711...
2711
     * RRULE:FREQ=MINUTELY;INTERVAL=20;BYHOUR=9,10,11,12,13,14,15,16;COUNT=50
2711
     * RRULE:FREQ=MINUTELY;INTERVAL=20;BYHOUR=9,10,11,12,13,14,15,16;COUNT=50
2712
     *   ==> (September 2, 1997 EDT)9:00,9:20,9:40,10:00,10:20,...16:00,16:20,16:40
2712
     *   ==> (September 2, 1997 EDT)9:00,9:20,9:40,10:00,10:20,...16:00,16:20,16:40
2713
     *       (September 3, 1997 EDT)9:00,9:20,9:40,10:00,10:20,...16:00,16:20,16:40
2713
     *       (September 3, 1997 EDT)9:00,9:20,9:40,10:00,10:20,...16:00,16:20,16:40
2714
     *       ...
2714
     *       ...
2715
     */
2715
     */
2716
    public function test_every_20minutes_minutely_byhour_50_count() {
2716
    public function test_every_20minutes_minutely_byhour_50_count(): void {
2717
        global $DB;
2717
        global $DB;
Línea 2718... Línea 2718...
2718
 
2718
 
2719
        $rrule = 'FREQ=MINUTELY;INTERVAL=20;BYHOUR=9,10,11,12,13,14,15,16;COUNT=50';
2719
        $rrule = 'FREQ=MINUTELY;INTERVAL=20;BYHOUR=9,10,11,12,13,14,15,16;COUNT=50';
2720
        $mang = new rrule_manager($rrule);
2720
        $mang = new rrule_manager($rrule);
Línea 2751... Línea 2751...
2751
     *
2751
     *
2752
     * DTSTART;TZID=US-Eastern:19970805T090000
2752
     * DTSTART;TZID=US-Eastern:19970805T090000
2753
     * RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=MO
2753
     * RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=MO
2754
     *   ==> (1997 EDT)Aug 5,10,19,24
2754
     *   ==> (1997 EDT)Aug 5,10,19,24
2755
     */
2755
     */
2756
    public function test_weekly_byday_with_wkst_mo() {
2756
    public function test_weekly_byday_with_wkst_mo(): void {
2757
        global $DB;
2757
        global $DB;
Línea 2758... Línea 2758...
2758
 
2758
 
Línea 2759... Línea 2759...
2759
        $this->change_event_startdate('19970805T090000', 'US/Eastern');
2759
        $this->change_event_startdate('19970805T090000', 'US/Eastern');
Línea 2784... Línea 2784...
2784
     *
2784
     *
2785
     * DTSTART;TZID=US-Eastern:19970805T090000
2785
     * DTSTART;TZID=US-Eastern:19970805T090000
2786
     * RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU
2786
     * RRULE:FREQ=WEEKLY;INTERVAL=2;COUNT=4;BYDAY=TU,SU;WKST=SU
2787
     *   ==> (1997 EDT)August 5,17,19,31
2787
     *   ==> (1997 EDT)August 5,17,19,31
2788
     */
2788
     */
2789
    public function test_weekly_byday_with_wkst_su() {
2789
    public function test_weekly_byday_with_wkst_su(): void {
2790
        global $DB;
2790
        global $DB;
Línea 2791... Línea 2791...
2791
 
2791
 
Línea 2792... Línea 2792...
2792
        $this->change_event_startdate('19970805T090000', 'US/Eastern');
2792
        $this->change_event_startdate('19970805T090000', 'US/Eastern');
Línea 2818... Línea 2818...
2818
 
2818
 
2819
    /**
2819
    /**
2820
     * Tests for MONTHLY RRULE with BYMONTHDAY set to 31.
2820
     * Tests for MONTHLY RRULE with BYMONTHDAY set to 31.
2821
     * Should not include February, April, June, September and November.
2821
     * Should not include February, April, June, September and November.
2822
     */
2822
     */
2823
    public function test_monthly_bymonthday_31() {
2823
    public function test_monthly_bymonthday_31(): void {
Línea 2824... Línea 2824...
2824
        global $DB;
2824
        global $DB;
2825
 
2825
 
2826
        $rrule = 'FREQ=MONTHLY;BYMONTHDAY=31;COUNT=20';
2826
        $rrule = 'FREQ=MONTHLY;BYMONTHDAY=31;COUNT=20';
Línea 2840... Línea 2840...
2840
    }
2840
    }
Línea 2841... Línea 2841...
2841
 
2841
 
2842
    /**
2842
    /**
2843
     * Tests for the last day in February. (Leap year test)
2843
     * Tests for the last day in February. (Leap year test)
2844
     */
2844
     */
2845
    public function test_yearly_on_the_last_day_of_february() {
2845
    public function test_yearly_on_the_last_day_of_february(): void {
Línea 2846... Línea 2846...
2846
        global $DB;
2846
        global $DB;
2847
 
2847
 
2848
        $rrule = 'FREQ=YEARLY;BYMONTH=2;BYMONTHDAY=-1;COUNT=30';
2848
        $rrule = 'FREQ=YEARLY;BYMONTH=2;BYMONTHDAY=-1;COUNT=30';