Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 42... Línea 42...
42
class basenestedelement_test extends \basic_testcase {
42
class basenestedelement_test extends \basic_testcase {
Línea 43... Línea 43...
43
 
43
 
44
    /**
44
    /**
45
     * Correct creation tests (attributes and final elements)
45
     * Correct creation tests (attributes and final elements)
46
     */
46
     */
47
    public function test_creation() {
47
    public function test_creation(): void {
48
        // Create instance with name, attributes and values and check all them
48
        // Create instance with name, attributes and values and check all them
49
        $instance = new mock_base_nested_element('NAME', array('ATTR1', 'ATTR2'), array('VAL1', 'VAL2', 'VAL3'));
49
        $instance = new mock_base_nested_element('NAME', array('ATTR1', 'ATTR2'), array('VAL1', 'VAL2', 'VAL3'));
50
        $this->assertInstanceOf('base_nested_element', $instance);
50
        $this->assertInstanceOf('base_nested_element', $instance);
51
        $this->assertEquals($instance->get_name(), 'NAME');
51
        $this->assertEquals($instance->get_name(), 'NAME');
Línea 180... Línea 180...
180
    }
180
    }
Línea 181... Línea 181...
181
 
181
 
182
    /**
182
    /**
183
     * Incorrect creation tests (attributes and final elements)
183
     * Incorrect creation tests (attributes and final elements)
184
     */
184
     */
Línea 185... Línea 185...
185
    function test_wrong_creation() {
185
    function test_wrong_creation(): void {
186
 
186
 
187
        // Create instance with invalid name
187
        // Create instance with invalid name
188
        try {
188
        try {
Línea 249... Línea 249...
249
    }
249
    }
Línea 250... Línea 250...
250
 
250
 
251
    /**
251
    /**
252
     * Correct tree tests (children stuff)
252
     * Correct tree tests (children stuff)
253
     */
253
     */
Línea 254... Línea 254...
254
    function test_tree() {
254
    function test_tree(): void {
255
 
255
 
256
        // Create parent and child instances, tree-ing them
256
        // Create parent and child instances, tree-ing them
257
        $parent = new mock_base_nested_element('PARENT');
257
        $parent = new mock_base_nested_element('PARENT');
Línea 303... Línea 303...
303
    }
303
    }
Línea 304... Línea 304...
304
 
304
 
305
    /**
305
    /**
306
     * Incorrect tree tests (children stuff)
306
     * Incorrect tree tests (children stuff)
307
     */
307
     */
Línea 308... Línea 308...
308
    function test_wrong_tree() {
308
    function test_wrong_tree(): void {
309
 
309
 
310
        // Add null object child
310
        // Add null object child
311
        $parent = new mock_base_nested_element('PARENT');
311
        $parent = new mock_base_nested_element('PARENT');