Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 73... Línea 73...
73
    }
73
    }
Línea 74... Línea 74...
74
 
74
 
75
    /**
75
    /**
76
     * Test for initialising field and data controllers
76
     * Test for initialising field and data controllers
77
     */
77
     */
78
    public function test_initialise() {
78
    public function test_initialise(): void {
79
        $f = \core_customfield\field_controller::create($this->cfields[1]->get('id'));
79
        $f = \core_customfield\field_controller::create($this->cfields[1]->get('id'));
Línea 80... Línea 80...
80
        $this->assertTrue($f instanceof field_controller);
80
        $this->assertTrue($f instanceof field_controller);
81
 
81
 
Línea 92... Línea 92...
92
    /**
92
    /**
93
     * Test for configuration form functions
93
     * Test for configuration form functions
94
     *
94
     *
95
     * Create a configuration form and submit it with the same values as in the field
95
     * Create a configuration form and submit it with the same values as in the field
96
     */
96
     */
97
    public function test_config_form() {
97
    public function test_config_form(): void {
98
        $this->setAdminUser();
98
        $this->setAdminUser();
99
        $submitdata = (array)$this->cfields[1]->to_record();
99
        $submitdata = (array)$this->cfields[1]->to_record();
100
        $submitdata['configdata'] = $this->cfields[1]->get('configdata');
100
        $submitdata['configdata'] = $this->cfields[1]->get('configdata');
Línea 101... Línea 101...
101
 
101
 
Línea 117... Línea 117...
117
    }
117
    }
Línea 118... Línea 118...
118
 
118
 
119
    /**
119
    /**
120
     * Test for instance form functions
120
     * Test for instance form functions
121
     */
121
     */
122
    public function test_instance_form() {
122
    public function test_instance_form(): void {
123
        global $CFG;
123
        global $CFG;
124
        require_once($CFG->dirroot . '/customfield/tests/fixtures/test_instance_form.php');
124
        require_once($CFG->dirroot . '/customfield/tests/fixtures/test_instance_form.php');
125
        $this->setAdminUser();
125
        $this->setAdminUser();
Línea 146... Línea 146...
146
    }
146
    }
Línea 147... Línea 147...
147
 
147
 
148
    /**
148
    /**
149
     * Test for data_controller::get_value and export_value
149
     * Test for data_controller::get_value and export_value
150
     */
150
     */
151
    public function test_get_export_value() {
151
    public function test_get_export_value(): void {
152
        $this->assertEquals(1, $this->cfdata[1]->get_value());
152
        $this->assertEquals(1, $this->cfdata[1]->get_value());
Línea 153... Línea 153...
153
        $this->assertEquals('Yes', $this->cfdata[1]->export_value());
153
        $this->assertEquals('Yes', $this->cfdata[1]->export_value());
154
 
154
 
Línea 164... Línea 164...
164
    }
164
    }
Línea 165... Línea 165...
165
 
165
 
166
    /**
166
    /**
167
     * Deleting fields and data
167
     * Deleting fields and data
168
     */
168
     */
169
    public function test_delete() {
169
    public function test_delete(): void {
170
        $this->cfcat->get_handler()->delete_all();
170
        $this->cfcat->get_handler()->delete_all();
171
    }
171
    }