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 that the enabled check perform as expected.
79
     * Test that the enabled check perform as expected.
80
     */
80
     */
81
    public function test_is_enabled() {
81
    public function test_is_enabled(): void {
Línea 82... Línea 82...
82
        global $CFG;
82
        global $CFG;
83
 
83
 
84
        // First clear all of the settings set in the setUp.
84
        // First clear all of the settings set in the setUp.
Línea 122... Línea 122...
122
 
122
 
123
    /**
123
    /**
124
     * Test that data items conform to RFCs 5231, and 5322 standards for
124
     * Test that data items conform to RFCs 5231, and 5322 standards for
125
     * addressing, and to RFC 5233 for sub-addressing.
125
     * addressing, and to RFC 5233 for sub-addressing.
126
     */
126
     */
127
    public function test_address_constraints() {
127
    public function test_address_constraints(): void {
Línea 128... Línea 128...
128
        $handler = $this->helper_create_handler('handler_one');
128
        $handler = $this->helper_create_handler('handler_one');
129
 
129
 
130
        // Using the handler created, generate an address for our data entry.
130
        // Using the handler created, generate an address for our data entry.
Línea 162... Línea 162...
162
    /**
162
    /**
163
     * Test that the generated e-mail addresses are sufficiently random by
163
     * Test that the generated e-mail addresses are sufficiently random by
164
     * testing the multiple handlers, multiple users, and multiple data
164
     * testing the multiple handlers, multiple users, and multiple data
165
     * items.
165
     * items.
166
     */
166
     */
167
    public function test_address_uniqueness() {
167
    public function test_address_uniqueness(): void {
168
        // Generate a set of handlers. These are in two components, and each
168
        // Generate a set of handlers. These are in two components, and each
169
        // component has two different generators.
169
        // component has two different generators.
170
        $handlers = array();
170
        $handlers = array();
171
        $handlers[] = $this->helper_create_handler('handler_one', true, 'core_test');
171
        $handlers[] = $this->helper_create_handler('handler_one', true, 'core_test');
172
        $handlers[] = $this->helper_create_handler('handler_two', true, 'core_test');
172
        $handlers[] = $this->helper_create_handler('handler_two', true, 'core_test');
Línea 208... Línea 208...
208
    }
208
    }
Línea 209... Línea 209...
209
 
209
 
210
    /**
210
    /**
211
     * Test address parsing of a generated address.
211
     * Test address parsing of a generated address.
212
     */
212
     */
213
    public function test_address_parsing() {
213
    public function test_address_parsing(): void {
Línea 214... Línea 214...
214
        $dataid = 42;
214
        $dataid = 42;
215
 
215
 
Línea 237... Línea 237...
237
    }
237
    }
Línea 238... Línea 238...
238
 
238
 
239
    /**
239
    /**
240
     * Test address parsing of an address with an unrecognised format.
240
     * Test address parsing of an address with an unrecognised format.
241
     */
241
     */
242
    public function test_address_validation_invalid_format_failure() {
242
    public function test_address_validation_invalid_format_failure(): void {
243
        // Create test data.
243
        // Create test data.
244
        $user = $this->getDataGenerator()->create_user();
244
        $user = $this->getDataGenerator()->create_user();
245
        $handler = $this->helper_create_handler('handler_one');
245
        $handler = $this->helper_create_handler('handler_one');
Línea 266... Línea 266...
266
    }
266
    }
Línea 267... Línea 267...
267
 
267
 
268
    /**
268
    /**
269
     * Test address parsing of an address with an unknown handler.
269
     * Test address parsing of an address with an unknown handler.
270
     */
270
     */
271
    public function test_address_validation_unknown_handler() {
271
    public function test_address_validation_unknown_handler(): void {
Línea 272... Línea 272...
272
        global $DB;
272
        global $DB;
273
 
273
 
274
        // Create test data.
274
        // Create test data.
Línea 295... Línea 295...
295
    }
295
    }
Línea 296... Línea 296...
296
 
296
 
297
    /**
297
    /**
298
     * Test address parsing of an address with a disabled handler.
298
     * Test address parsing of an address with a disabled handler.
299
     */
299
     */
300
    public function test_address_validation_disabled_handler() {
300
    public function test_address_validation_disabled_handler(): void {
Línea 301... Línea 301...
301
        global $DB;
301
        global $DB;
302
 
302
 
303
        // Create test data.
303
        // Create test data.
Línea 324... Línea 324...
324
    }
324
    }
Línea 325... Línea 325...
325
 
325
 
326
    /**
326
    /**
327
     * Test address parsing of an address for an invalid user.
327
     * Test address parsing of an address for an invalid user.
328
     */
328
     */
329
    public function test_address_validation_invalid_user() {
329
    public function test_address_validation_invalid_user(): void {
Línea 330... Línea 330...
330
        global $DB;
330
        global $DB;
331
 
331
 
332
        // Create test data.
332
        // Create test data.
Línea 348... Línea 348...
348
    }
348
    }
Línea 349... Línea 349...
349
 
349
 
350
    /**
350
    /**
351
     * Test address parsing of an address for a disabled user.
351
     * Test address parsing of an address for a disabled user.
352
     */
352
     */
353
    public function test_address_validation_disabled_user() {
353
    public function test_address_validation_disabled_user(): void {
Línea 354... Línea 354...
354
        global $DB;
354
        global $DB;
355
 
355
 
356
        // Create test data.
356
        // Create test data.
Línea 376... Línea 376...
376
    }
376
    }
Línea 377... Línea 377...
377
 
377
 
378
    /**
378
    /**
379
     * Test address parsing of an address for an invalid key.
379
     * Test address parsing of an address for an invalid key.
380
     */
380
     */
381
    public function test_address_validation_invalid_key() {
381
    public function test_address_validation_invalid_key(): void {
Línea 382... Línea 382...
382
        global $DB;
382
        global $DB;
383
 
383
 
384
        // Create test data.
384
        // Create test data.
Línea 406... Línea 406...
406
    }
406
    }
Línea 407... Línea 407...
407
 
407
 
408
    /**
408
    /**
409
     * Test address parsing of an address for an expired key.
409
     * Test address parsing of an address for an expired key.
410
     */
410
     */
411
    public function test_address_validation_expired_key() {
411
    public function test_address_validation_expired_key(): void {
Línea 412... Línea 412...
412
        global $DB;
412
        global $DB;
413
 
413
 
414
        // Create test data.
414
        // Create test data.
Línea 439... Línea 439...
439
    }
439
    }
Línea 440... Línea 440...
440
 
440
 
441
    /**
441
    /**
442
     * Test address parsing of an address for an invalid hash.
442
     * Test address parsing of an address for an invalid hash.
443
     */
443
     */
444
    public function test_address_validation_invalid_hash() {
444
    public function test_address_validation_invalid_hash(): void {
Línea 445... Línea 445...
445
        global $DB;
445
        global $DB;
446
 
446
 
447
        // Create test data.
447
        // Create test data.
Línea 472... Línea 472...
472
    }
472
    }
Línea 473... Línea 473...
473
 
473
 
474
    /**
474
    /**
475
     * Test address parsing of an address for an invalid sender.
475
     * Test address parsing of an address for an invalid sender.
476
     */
476
     */
477
    public function test_address_validation_invalid_sender() {
477
    public function test_address_validation_invalid_sender(): void {
Línea 478... Línea 478...
478
        global $DB;
478
        global $DB;
479
 
479
 
480
        // Create test data.
480
        // Create test data.
Línea 496... Línea 496...
496
    }
496
    }
Línea 497... Línea 497...
497
 
497
 
498
    /**
498
    /**
499
     * Test address parsing of an address for an address which is correct.
499
     * Test address parsing of an address for an address which is correct.
500
     */
500
     */
501
    public function test_address_validation_success() {
501
    public function test_address_validation_success(): void {
Línea 502... Línea 502...
502
        global $DB;
502
        global $DB;
503
 
503
 
504
        // Create test data.
504
        // Create test data.
Línea 521... Línea 521...
521
 
521
 
522
    /**
522
    /**
523
     * Test that a handler with no default expiration does not have an
523
     * Test that a handler with no default expiration does not have an
524
     * expiration time applied.
524
     * expiration time applied.
525
     */
525
     */
526
    public function test_default_hander_expiry_unlimited() {
526
    public function test_default_hander_expiry_unlimited(): void {
Línea 527... Línea 527...
527
        global $DB;
527
        global $DB;
528
 
528
 
Línea 552... Línea 552...
552
    }
552
    }
Línea 553... Línea 553...
553
 
553
 
554
    /**
554
    /**
555
     * Test application of the default expiry on a handler.
555
     * Test application of the default expiry on a handler.
556
     */
556
     */
557
    public function test_default_hander_expiry_low() {
557
    public function test_default_hander_expiry_low(): void {
Línea 558... Línea 558...
558
        global $DB;
558
        global $DB;
559
 
559
 
Línea 583... Línea 583...
583
    }
583
    }
Línea 584... Línea 584...
584
 
584
 
585
    /**
585
    /**
586
     * Test application of the default expiry on a handler.
586
     * Test application of the default expiry on a handler.
587
     */
587
     */
588
    public function test_default_hander_expiry_medium() {
588
    public function test_default_hander_expiry_medium(): void {
Línea 589... Línea 589...
589
        global $DB;
589
        global $DB;
590
 
590