Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 38... Línea 38...
38
class externallib_test extends externallib_advanced_testcase {
38
class externallib_test extends externallib_advanced_testcase {
Línea 39... Línea 39...
39
 
39
 
40
    /**
40
    /**
41
     * Test get_enrolled_users
41
     * Test get_enrolled_users
42
     */
42
     */
43
    public function test_enrol_users() {
43
    public function test_enrol_users(): void {
Línea 44... Línea 44...
44
        global $DB;
44
        global $DB;
Línea 45... Línea 45...
45
 
45
 
Línea 127... Línea 127...
127
     * Test for unerolling a single user.
127
     * Test for unerolling a single user.
128
     * @throws coding_exception
128
     * @throws coding_exception
129
     * @throws invalid_parameter_exception
129
     * @throws invalid_parameter_exception
130
     * @throws moodle_exception
130
     * @throws moodle_exception
131
     */
131
     */
132
    public function test_unenrol_user_single() {
132
    public function test_unenrol_user_single(): void {
133
        global $CFG, $DB;
133
        global $CFG, $DB;
134
        require_once($CFG->libdir . '/enrollib.php');
134
        require_once($CFG->libdir . '/enrollib.php');
135
        $this->resetAfterTest(true);
135
        $this->resetAfterTest(true);
136
        // The user who perform the action.
136
        // The user who perform the action.
137
        $user = $this->getDataGenerator()->create_user();
137
        $user = $this->getDataGenerator()->create_user();
Línea 161... Línea 161...
161
     * Test for unenrolling multiple users.
161
     * Test for unenrolling multiple users.
162
     * @throws coding_exception
162
     * @throws coding_exception
163
     * @throws invalid_parameter_exception
163
     * @throws invalid_parameter_exception
164
     * @throws moodle_exception
164
     * @throws moodle_exception
165
     */
165
     */
166
    public function test_unenrol_user_multiple() {
166
    public function test_unenrol_user_multiple(): void {
167
        global $CFG, $DB;
167
        global $CFG, $DB;
168
        require_once($CFG->libdir . '/enrollib.php');
168
        require_once($CFG->libdir . '/enrollib.php');
169
        $this->resetAfterTest(true);
169
        $this->resetAfterTest(true);
170
        // The user who perform the action.
170
        // The user who perform the action.
171
        $user = $this->getDataGenerator()->create_user();
171
        $user = $this->getDataGenerator()->create_user();
Línea 200... Línea 200...
200
     * Test for unenrol capability.
200
     * Test for unenrol capability.
201
     * @throws coding_exception
201
     * @throws coding_exception
202
     * @throws invalid_parameter_exception
202
     * @throws invalid_parameter_exception
203
     * @throws moodle_exception
203
     * @throws moodle_exception
204
     */
204
     */
205
    public function test_unenrol_user_error_no_capability() {
205
    public function test_unenrol_user_error_no_capability(): void {
206
        global $CFG, $DB;
206
        global $CFG, $DB;
207
        require_once($CFG->libdir . '/enrollib.php');
207
        require_once($CFG->libdir . '/enrollib.php');
208
        $this->resetAfterTest(true);
208
        $this->resetAfterTest(true);
209
        // The user who perform the action.
209
        // The user who perform the action.
210
        $user = $this->getDataGenerator()->create_user();
210
        $user = $this->getDataGenerator()->create_user();
Línea 247... Línea 247...
247
 
247
 
248
    /**
248
    /**
249
     * Test for unenrol if user does not exist.
249
     * Test for unenrol if user does not exist.
250
     * @throws coding_exception
250
     * @throws coding_exception
251
     */
251
     */
252
    public function test_unenrol_user_error_not_exist() {
252
    public function test_unenrol_user_error_not_exist(): void {
253
        global $CFG, $DB;
253
        global $CFG, $DB;
254
        require_once($CFG->libdir . '/enrollib.php');
254
        require_once($CFG->libdir . '/enrollib.php');
255
        $this->resetAfterTest(true);
255
        $this->resetAfterTest(true);
256
        // The user who perform the action.
256
        // The user who perform the action.