Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 38... Línea 38...
38
     * Tests log writing.
38
     * Tests log writing.
39
     *
39
     *
40
     * @param bool $jsonformat True to test with JSON format
40
     * @param bool $jsonformat True to test with JSON format
41
     * @dataProvider log_writing_provider
41
     * @dataProvider log_writing_provider
42
     */
42
     */
43
    public function test_log_writing(bool $jsonformat) {
43
    public function test_log_writing(bool $jsonformat): void {
44
        global $DB;
44
        global $DB;
45
        $this->resetAfterTest();
45
        $this->resetAfterTest();
46
        $this->preventResetByRollback(); // Logging waits till the transaction gets committed.
46
        $this->preventResetByRollback(); // Logging waits till the transaction gets committed.
Línea 47... Línea 47...
47
 
47
 
Línea 236... Línea 236...
236
    }
236
    }
Línea 237... Línea 237...
237
 
237
 
238
    /**
238
    /**
239
     * Test logmanager::get_supported_reports returns all reports that require this store.
239
     * Test logmanager::get_supported_reports returns all reports that require this store.
240
     */
240
     */
241
    public function test_get_supported_reports() {
241
    public function test_get_supported_reports(): void {
242
        $logmanager = get_log_manager();
242
        $logmanager = get_log_manager();
Línea 243... Línea 243...
243
        $allreports = \core_component::get_plugin_list('report');
243
        $allreports = \core_component::get_plugin_list('report');
244
 
244
 
Línea 259... Línea 259...
259
    }
259
    }
Línea 260... Línea 260...
260
 
260
 
261
    /**
261
    /**
262
     * Verify that gc disabling works
262
     * Verify that gc disabling works
263
     */
263
     */
264
    public function test_gc_enabled_as_expected() {
264
    public function test_gc_enabled_as_expected(): void {
265
        if (!gc_enabled()) {
265
        if (!gc_enabled()) {
266
            $this->markTestSkipped('Garbage collector (gc) is globally disabled.');
266
            $this->markTestSkipped('Garbage collector (gc) is globally disabled.');
Línea 267... Línea 267...
267
        }
267
        }
Línea 273... Línea 273...
273
 
273
 
274
    /**
274
    /**
275
     * Test sql_reader::get_events_select_iterator.
275
     * Test sql_reader::get_events_select_iterator.
276
     * @return void
276
     * @return void
277
     */
277
     */
278
    public function test_events_traversable() {
278
    public function test_events_traversable(): void {
Línea 279... Línea 279...
279
        global $DB;
279
        global $DB;
Línea 280... Línea 280...
280
 
280
 
Línea 330... Línea 330...
330
    }
330
    }
Línea 331... Línea 331...
331
 
331
 
332
    /**
332
    /**
333
     * Test that the standard log cleanup works correctly.
333
     * Test that the standard log cleanup works correctly.
334
     */
334
     */
335
    public function test_cleanup_task() {
335
    public function test_cleanup_task(): void {
Línea 336... Línea 336...
336
        global $DB;
336
        global $DB;
Línea 337... Línea 337...
337
 
337
 
Línea 370... Línea 370...
370
     * Tests the decode_other function can cope with both JSON and PHP serialized format.
370
     * Tests the decode_other function can cope with both JSON and PHP serialized format.
371
     *
371
     *
372
     * @param mixed $value Value to encode and decode
372
     * @param mixed $value Value to encode and decode
373
     * @dataProvider decode_other_provider
373
     * @dataProvider decode_other_provider
374
     */
374
     */
375
    public function test_decode_other($value) {
375
    public function test_decode_other($value): void {
376
        $this->assertEquals($value, \logstore_standard\log\store::decode_other(serialize($value)));
376
        $this->assertEquals($value, \logstore_standard\log\store::decode_other(serialize($value)));
377
        $this->assertEquals($value, \logstore_standard\log\store::decode_other(json_encode($value)));
377
        $this->assertEquals($value, \logstore_standard\log\store::decode_other(json_encode($value)));
378
    }
378
    }
Línea 379... Línea 379...
379
 
379
 
380
    public function test_decode_other_with_wrongly_encoded_contents() {
380
    public function test_decode_other_with_wrongly_encoded_contents(): void {
381
        $this->assertSame(null, \logstore_standard\log\store::decode_other(null));
381
        $this->assertSame(null, \logstore_standard\log\store::decode_other(null));
Línea 382... Línea 382...
382
    }
382
    }
383
 
383
 
Línea 402... Línea 402...
402
     * Checks that backup and restore of log data works correctly.
402
     * Checks that backup and restore of log data works correctly.
403
     *
403
     *
404
     * @param bool $jsonformat True to test with JSON format
404
     * @param bool $jsonformat True to test with JSON format
405
     * @dataProvider log_writing_provider
405
     * @dataProvider log_writing_provider
406
     */
406
     */
407
    public function test_backup_restore(bool $jsonformat) {
407
    public function test_backup_restore(bool $jsonformat): void {
408
        global $DB;
408
        global $DB;
409
        $this->resetAfterTest();
409
        $this->resetAfterTest();
410
        $this->preventResetByRollback();
410
        $this->preventResetByRollback();
Línea 411... Línea 411...
411
 
411