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
class manager_test extends advanced_testcase {
39
class manager_test extends advanced_testcase {
Línea 40... Línea 40...
40
 
40
 
41
    /**
41
    /**
42
     * Test editing a license.
42
     * Test editing a license.
43
     */
43
     */
44
    public function test_edit_existing_license() {
44
    public function test_edit_existing_license(): void {
Línea 45... Línea 45...
45
        $this->resetAfterTest();
45
        $this->resetAfterTest();
46
 
46
 
47
        // Create initial custom license to edit.
47
        // Create initial custom license to edit.
Línea 82... Línea 82...
82
        $this->assertSame($formdata['fullname'], $actual->fullname);
82
        $this->assertSame($formdata['fullname'], $actual->fullname);
83
        $this->assertSame($formdata['source'], $actual->source);
83
        $this->assertSame($formdata['source'], $actual->source);
84
        $this->assertSame(date('Ymd', $formdata['version']) . '00', $actual->version);
84
        $this->assertSame(date('Ymd', $formdata['version']) . '00', $actual->version);
85
    }
85
    }
Línea 86... Línea 86...
86
 
86
 
87
    public function test_edit_license_not_exists() {
87
    public function test_edit_license_not_exists(): void {
Línea 88... Línea 88...
88
        $manager = new \tool_licensemanager\manager();
88
        $manager = new \tool_licensemanager\manager();
89
 
89
 
Línea 102... Línea 102...
102
        // Should not be able to update a license with a shortname that doesn't exist.
102
        // Should not be able to update a license with a shortname that doesn't exist.
103
        $this->expectException('moodle_exception');
103
        $this->expectException('moodle_exception');
104
        $method->invoke($manager, \tool_licensemanager\manager::ACTION_UPDATE, $formdata['shortname']);
104
        $method->invoke($manager, \tool_licensemanager\manager::ACTION_UPDATE, $formdata['shortname']);
105
    }
105
    }
Línea 106... Línea 106...
106
 
106
 
107
    public function test_edit_license_no_shortname() {
107
    public function test_edit_license_no_shortname(): void {
Línea 108... Línea 108...
108
        $manager = new \tool_licensemanager\manager();
108
        $manager = new \tool_licensemanager\manager();
109
 
109
 
Línea 124... Línea 124...
124
    }
124
    }
Línea 125... Línea 125...
125
 
125
 
126
    /**
126
    /**
127
     * Test creating a new license.
127
     * Test creating a new license.
128
     */
128
     */
129
    public function test_edit_create_license() {
129
    public function test_edit_create_license(): void {
Línea 130... Línea 130...
130
        $this->resetAfterTest();
130
        $this->resetAfterTest();
Línea 131... Línea 131...
131
 
131
 
Línea 164... Línea 164...
164
    }
164
    }
Línea 165... Línea 165...
165
 
165
 
166
    /**
166
    /**
167
     * Test changing the order of licenses.
167
     * Test changing the order of licenses.
168
     */
168
     */
169
    public function test_change_license_order() {
169
    public function test_change_license_order(): void {
Línea 170... Línea 170...
170
        $this->resetAfterTest();
170
        $this->resetAfterTest();
171
 
171