Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 79... Línea 79...
79
    }
79
    }
Línea 80... Línea 80...
80
 
80
 
81
    /**
81
    /**
82
     * Test for initialising field and data controllers
82
     * Test for initialising field and data controllers
83
     */
83
     */
84
    public function test_initialise() {
84
    public function test_initialise(): void {
85
        $f = \core_customfield\field_controller::create($this->cfields[1]->get('id'));
85
        $f = \core_customfield\field_controller::create($this->cfields[1]->get('id'));
Línea 86... Línea 86...
86
        $this->assertTrue($f instanceof field_controller);
86
        $this->assertTrue($f instanceof field_controller);
87
 
87
 
Línea 98... Línea 98...
98
    /**
98
    /**
99
     * Test for configuration form functions
99
     * Test for configuration form functions
100
     *
100
     *
101
     * Create a configuration form and submit it with the same values as in the field
101
     * Create a configuration form and submit it with the same values as in the field
102
     */
102
     */
103
    public function test_config_form() {
103
    public function test_config_form(): void {
104
        $this->setAdminUser();
104
        $this->setAdminUser();
105
        $submitdata = (array)$this->cfields[1]->to_record();
105
        $submitdata = (array)$this->cfields[1]->to_record();
106
        $submitdata['configdata'] = $this->cfields[1]->get('configdata');
106
        $submitdata['configdata'] = $this->cfields[1]->get('configdata');
Línea 107... Línea 107...
107
 
107
 
Línea 114... Línea 114...
114
    }
114
    }
Línea 115... Línea 115...
115
 
115
 
116
    /**
116
    /**
117
     * Test for instance form functions
117
     * Test for instance form functions
118
     */
118
     */
119
    public function test_instance_form() {
119
    public function test_instance_form(): void {
120
        global $CFG;
120
        global $CFG;
121
        require_once($CFG->dirroot . '/customfield/tests/fixtures/test_instance_form.php');
121
        require_once($CFG->dirroot . '/customfield/tests/fixtures/test_instance_form.php');
122
        $this->setAdminUser();
122
        $this->setAdminUser();
Línea 143... Línea 143...
143
    }
143
    }
Línea 144... Línea 144...
144
 
144
 
145
    /**
145
    /**
146
     * Test for data_controller::get_value and export_value
146
     * Test for data_controller::get_value and export_value
147
     */
147
     */
148
    public function test_get_export_value() {
148
    public function test_get_export_value(): void {
149
        $this->assertEquals('Value1', $this->cfdata[1]->get_value());
149
        $this->assertEquals('Value1', $this->cfdata[1]->get_value());
Línea 150... Línea 150...
150
        $this->assertEquals('Value1', $this->cfdata[1]->export_value());
150
        $this->assertEquals('Value1', $this->cfdata[1]->export_value());
151
 
151
 
Línea 161... Línea 161...
161
    }
161
    }
Línea 162... Línea 162...
162
 
162
 
163
    /**
163
    /**
164
     * Deleting fields and data
164
     * Deleting fields and data
165
     */
165
     */
166
    public function test_delete() {
166
    public function test_delete(): void {
167
        $this->cfcat->get_handler()->delete_all();
167
        $this->cfcat->get_handler()->delete_all();
168
    }
168
    }