Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 39... Línea 39...
39
    public function setUp(): void {
39
    public function setUp(): void {
40
        $this->setAdminUser();
40
        $this->setAdminUser();
41
        $this->resetAfterTest();
41
        $this->resetAfterTest();
42
    }
42
    }
Línea 43... Línea 43...
43
 
43
 
44
    public function test_langpack_updated() {
44
    public function test_langpack_updated(): void {
Línea 45... Línea 45...
45
        global $CFG;
45
        global $CFG;
Línea 46... Línea 46...
46
 
46
 
Línea 54... Línea 54...
54
 
54
 
55
        $this->assertInstanceOf('\tool_langimport\event\langpack_updated', $event);
55
        $this->assertInstanceOf('\tool_langimport\event\langpack_updated', $event);
56
        $this->assertEquals(\context_system::instance(), $event->get_context());
56
        $this->assertEquals(\context_system::instance(), $event->get_context());
Línea 57... Línea 57...
57
    }
57
    }
Línea 58... Línea 58...
58
 
58
 
59
    public function test_langpack_updated_validation() {
59
    public function test_langpack_updated_validation(): void {
60
 
60
 
61
        $this->expectException('coding_exception');
61
        $this->expectException('coding_exception');
Línea 62... Línea 62...
62
        $this->expectExceptionMessage("The 'langcode' value must be set to a valid language code");
62
        $this->expectExceptionMessage("The 'langcode' value must be set to a valid language code");
63
        \tool_langimport\event\langpack_updated::event_with_langcode('broken langcode');
63
        \tool_langimport\event\langpack_updated::event_with_langcode('broken langcode');
Línea 64... Línea 64...
64
    }
64
    }
65
 
65
 
66
    public function test_langpack_installed() {
66
    public function test_langpack_installed(): void {
Línea 74... Línea 74...
74
 
74
 
75
        $this->assertInstanceOf('\tool_langimport\event\langpack_imported', $event);
75
        $this->assertInstanceOf('\tool_langimport\event\langpack_imported', $event);
76
        $this->assertEquals(\context_system::instance(), $event->get_context());
76
        $this->assertEquals(\context_system::instance(), $event->get_context());
Línea 77... Línea 77...
77
    }
77
    }
Línea 78... Línea 78...
78
 
78
 
79
    public function test_langpack_installed_validation() {
79
    public function test_langpack_installed_validation(): void {
80
 
80
 
81
        $this->expectException('coding_exception');
81
        $this->expectException('coding_exception');
Línea 82... Línea 82...
82
        $this->expectExceptionMessage("The 'langcode' value must be set to a valid language code");
82
        $this->expectExceptionMessage("The 'langcode' value must be set to a valid language code");
83
        \tool_langimport\event\langpack_imported::event_with_langcode('broken langcode');
83
        \tool_langimport\event\langpack_imported::event_with_langcode('broken langcode');
Línea 84... Línea 84...
84
    }
84
    }
85
 
85
 
86
    public function test_langpack_removed() {
86
    public function test_langpack_removed(): void {
Línea 94... Línea 94...
94
 
94
 
95
        $this->assertInstanceOf('\tool_langimport\event\langpack_removed', $event);
95
        $this->assertInstanceOf('\tool_langimport\event\langpack_removed', $event);
96
        $this->assertEquals(\context_system::instance(), $event->get_context());
96
        $this->assertEquals(\context_system::instance(), $event->get_context());
Línea 97... Línea 97...
97
    }
97
    }
Línea 98... Línea 98...
98
 
98
 
99
    public function test_langpack_removed_validation() {
99
    public function test_langpack_removed_validation(): void {
100
 
100
 
101
        $this->expectException('coding_exception');
101
        $this->expectException('coding_exception');