Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 51... Línea 51...
51
            $this->escape($nodetext)
51
            $this->escape($nodetext)
52
        ]);
52
        ]);
53
    }
53
    }
Línea 54... Línea 54...
54
 
54
 
-
 
55
    /**
-
 
56
     * Deletes a user.
-
 
57
     *
-
 
58
     * @Given the user :identifier is deleted
-
 
59
     * @param string $identifier
-
 
60
     */
-
 
61
    #[\core\attribute\example('And the user student1 is deleted')]
-
 
62
    public function the_user_is_deleted($identifier) {
-
 
63
        global $DB;
-
 
64
        $userid = $this->get_user_id_by_identifier($identifier);
-
 
65
        if (!$userid) {
-
 
66
            throw new moodle_exception('The specified user with username or email "' . $identifier . '" does not exist');
-
 
67
        }
-
 
68
        delete_user($DB->get_record('user', ['id' => $userid]));
-
 
69
    }
-
 
70
 
55
    /**
71
    /**
56
     * The input field should have autocomplete set to this value.
72
     * The input field should have autocomplete set to this value.
57
     *
73
     *
58
     * @Then /^the field "(?P<field_string>(?:[^"]|\\")*)" should have purpose "(?P<purpose_string>(?:[^"]|\\")*)"$/
74
     * @Then /^the field "(?P<field_string>(?:[^"]|\\")*)" should have purpose "(?P<purpose_string>(?:[^"]|\\")*)"$/
59
     * @param string $field The field to select.
75
     * @param string $field The field to select.