Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 80... Línea 80...
80
    }
80
    }
Línea 81... Línea 81...
81
 
81
 
82
    /**
82
    /**
83
     * Test for initialising field and data controllers
83
     * Test for initialising field and data controllers
84
     */
84
     */
85
    public function test_initialise() {
85
    public function test_initialise(): void {
86
        $f = \core_customfield\field_controller::create($this->cfields[1]->get('id'));
86
        $f = \core_customfield\field_controller::create($this->cfields[1]->get('id'));
Línea 87... Línea 87...
87
        $this->assertTrue($f instanceof field_controller);
87
        $this->assertTrue($f instanceof field_controller);
88
 
88
 
Línea 99... Línea 99...
99
    /**
99
    /**
100
     * Test for configuration form functions
100
     * Test for configuration form functions
101
     *
101
     *
102
     * Create a configuration form and submit it with the same values as in the field
102
     * Create a configuration form and submit it with the same values as in the field
103
     */
103
     */
104
    public function test_config_form() {
104
    public function test_config_form(): void {
105
        $this->setAdminUser();
105
        $this->setAdminUser();
106
        $submitdata = (array)$this->cfields[3]->to_record();
106
        $submitdata = (array)$this->cfields[3]->to_record();
107
        $submitdata['configdata'] = $this->cfields[3]->get('configdata');
107
        $submitdata['configdata'] = $this->cfields[3]->get('configdata');
Línea 108... Línea 108...
108
 
108
 
Línea 115... Línea 115...
115
    }
115
    }
Línea 116... Línea 116...
116
 
116
 
117
    /**
117
    /**
118
     * Test for instance form functions
118
     * Test for instance form functions
119
     */
119
     */
120
    public function test_instance_form() {
120
    public function test_instance_form(): void {
121
        global $CFG;
121
        global $CFG;
122
        require_once($CFG->dirroot . '/customfield/tests/fixtures/test_instance_form.php');
122
        require_once($CFG->dirroot . '/customfield/tests/fixtures/test_instance_form.php');
123
        $this->setAdminUser();
123
        $this->setAdminUser();
Línea 179... Línea 179...
179
    }
179
    }
Línea 180... Línea 180...
180
 
180
 
181
    /**
181
    /**
182
     * Test for data_controller::get_value and export_value
182
     * Test for data_controller::get_value and export_value
183
     */
183
     */
184
    public function test_get_export_value() {
184
    public function test_get_export_value(): void {
185
        $this->assertEquals('Value1', $this->cfdata[1]->get_value());
185
        $this->assertEquals('Value1', $this->cfdata[1]->get_value());
Línea 186... Línea 186...
186
        $this->assertEquals('<div class="text_to_html">Value1</div>', $this->cfdata[1]->export_value());
186
        $this->assertEquals('<div class="text_to_html">Value1</div>', $this->cfdata[1]->export_value());
187
 
187
 
Línea 195... Línea 195...
195
    }
195
    }
Línea 196... Línea 196...
196
 
196
 
197
    /**
197
    /**
198
     * Deleting fields and data
198
     * Deleting fields and data
199
     */
199
     */
200
    public function test_delete() {
200
    public function test_delete(): void {
201
        $this->cfcat->get_handler()->delete_all();
201
        $this->cfcat->get_handler()->delete_all();
Línea 202... Línea 202...
202
    }
202
    }
203
 
203