Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 116... Línea 116...
116
    }
116
    }
Línea 117... Línea 117...
117
 
117
 
118
    /**
118
    /**
119
     * Verify get_total_users() returned number of users expected in every situation.
119
     * Verify get_total_users() returned number of users expected in every situation.
120
     */
120
     */
121
    public function test_get_total_users() {
121
    public function test_get_total_users(): void {
Línea 122... Línea 122...
122
        global $PAGE;
122
        global $PAGE;
Línea 123... Línea 123...
123
 
123
 
Línea 170... Línea 170...
170
    }
170
    }
Línea 171... Línea 171...
171
 
171
 
172
    /**
172
    /**
173
     * Verify get_users() returned number of users expected in every situation.
173
     * Verify get_users() returned number of users expected in every situation.
174
     */
174
     */
175
    public function test_get_users() {
175
    public function test_get_users(): void {
Línea 176... Línea 176...
176
        global $PAGE;
176
        global $PAGE;
Línea 177... Línea 177...
177
 
177
 
Línea 268... Línea 268...
268
    }
268
    }
Línea 269... Línea 269...
269
 
269
 
270
    /**
270
    /**
271
     * Checks that the get_users function returns the correct user fields.
271
     * Checks that the get_users function returns the correct user fields.
272
     */
272
     */
273
    public function test_get_users_fields() {
273
    public function test_get_users_fields(): void {
Línea 274... Línea 274...
274
        global $PAGE;
274
        global $PAGE;
275
 
275
 
Línea 300... Línea 300...
300
    }
300
    }
Línea 301... Línea 301...
301
 
301
 
302
    /**
302
    /**
303
     * Checks that the get_other_users function returns the correct user fields.
303
     * Checks that the get_other_users function returns the correct user fields.
304
     */
304
     */
305
    public function test_get_other_users_fields() {
305
    public function test_get_other_users_fields(): void {
Línea 306... Línea 306...
306
        global $PAGE, $DB;
306
        global $PAGE, $DB;
Línea 307... Línea 307...
307
 
307
 
Línea 334... Línea 334...
334
    }
334
    }
Línea 335... Línea 335...
335
 
335
 
336
    /**
336
    /**
337
     * Checks that the get_potential_users function returns the correct user fields.
337
     * Checks that the get_potential_users function returns the correct user fields.
338
     */
338
     */
339
    public function test_get_potential_users_fields() {
339
    public function test_get_potential_users_fields(): void {
Línea 340... Línea 340...
340
        global $PAGE;
340
        global $PAGE;
Línea 341... Línea 341...
341
 
341
 
Línea 379... Línea 379...
379
     * @param bool $returnexactcount Return the exact count or not.
379
     * @param bool $returnexactcount Return the exact count or not.
380
     * @param int $expectedusers Expected number of users return.
380
     * @param int $expectedusers Expected number of users return.
381
     * @param int $expectedtotalusers Expected total of users in database.
381
     * @param int $expectedtotalusers Expected total of users in database.
382
     * @param bool $expectedmoreusers Expected for more users return or not.
382
     * @param bool $expectedmoreusers Expected for more users return or not.
383
     */
383
     */
384
    public function test_get_potential_users($perpage, $returnexactcount, $expectedusers, $expectedtotalusers, $expectedmoreusers) {
384
    public function test_get_potential_users($perpage, $returnexactcount, $expectedusers, $expectedtotalusers, $expectedmoreusers): void {
385
        global $DB, $PAGE;
385
        global $DB, $PAGE;
386
        $this->resetAfterTest();
386
        $this->resetAfterTest();
387
        $this->setAdminUser();
387
        $this->setAdminUser();
Línea 388... Línea 388...
388
 
388
 
Línea 407... Línea 407...
407
    }
407
    }
Línea 408... Línea 408...
408
 
408
 
409
    /**
409
    /**
410
     * Tests get_potential_users when the search term includes a custom field.
410
     * Tests get_potential_users when the search term includes a custom field.
411
     */
411
     */
412
    public function test_get_potential_users_search_fields() {
412
    public function test_get_potential_users_search_fields(): void {
Línea 413... Línea 413...
413
        global $PAGE;
413
        global $PAGE;
Línea 414... Línea 414...
414
 
414
 
Línea 473... Línea 473...
473
     * @param bool $returnexactcount Return the exact count or not.
473
     * @param bool $returnexactcount Return the exact count or not.
474
     * @param int $expectedusers Expected number of users return.
474
     * @param int $expectedusers Expected number of users return.
475
     * @param int $expectedtotalusers Expected total of users in database.
475
     * @param int $expectedtotalusers Expected total of users in database.
476
     * @param bool $expectedmoreusers Expected for more users return or not.
476
     * @param bool $expectedmoreusers Expected for more users return or not.
477
     */
477
     */
478
    public function test_search_other_users($perpage, $returnexactcount, $expectedusers, $expectedtotalusers, $expectedmoreusers) {
478
    public function test_search_other_users($perpage, $returnexactcount, $expectedusers, $expectedtotalusers, $expectedmoreusers): void {
479
        global $PAGE;
479
        global $PAGE;
480
        $this->resetAfterTest();
480
        $this->resetAfterTest();
481
        $this->setAdminUser();
481
        $this->setAdminUser();
Línea 482... Línea 482...
482
 
482
 
Línea 521... Línea 521...
521
     * @param bool $returnexactcount Return the exact count or not.
521
     * @param bool $returnexactcount Return the exact count or not.
522
     * @param int $expectedusers Expected number of users return.
522
     * @param int $expectedusers Expected number of users return.
523
     * @param int $expectedtotalusers Expected total of users in database.
523
     * @param int $expectedtotalusers Expected total of users in database.
524
     * @param bool $expectedmoreusers Expected for more users return or not.
524
     * @param bool $expectedmoreusers Expected for more users return or not.
525
     */
525
     */
526
    public function test_search_users($perpage, $returnexactcount, $expectedusers, $expectedtotalusers, $expectedmoreusers) {
526
    public function test_search_users($perpage, $returnexactcount, $expectedusers, $expectedtotalusers, $expectedmoreusers): void {
527
        global $PAGE;
527
        global $PAGE;
528
        $this->resetAfterTest();
528
        $this->resetAfterTest();
Línea 529... Línea 529...
529
 
529
 
530
        $this->getDataGenerator()->create_and_enrol($this->course, 'student', ['firstname' => 'sutest 1']);
530
        $this->getDataGenerator()->create_and_enrol($this->course, 'student', ['firstname' => 'sutest 1']);