Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 53... Línea 53...
53
    }
53
    }
Línea 54... Línea 54...
54
 
54
 
55
    /**
55
    /**
56
     * Tests constructing and using date condition as part of tree.
56
     * Tests constructing and using date condition as part of tree.
57
     */
57
     */
58
    public function test_in_tree() {
58
    public function test_in_tree(): void {
Línea 59... Línea 59...
59
        global $USER;
59
        global $USER;
Línea 60... Línea 60...
60
 
60
 
Línea 82... Línea 82...
82
 
82
 
83
    /**
83
    /**
84
     * Tests the constructor including error conditions. Also tests the
84
     * Tests the constructor including error conditions. Also tests the
85
     * string conversion feature (intended for debugging only).
85
     * string conversion feature (intended for debugging only).
86
     */
86
     */
87
    public function test_constructor() {
87
    public function test_constructor(): void {
88
        // No parameters.
88
        // No parameters.
89
        $structure = new \stdClass();
89
        $structure = new \stdClass();
90
        try {
90
        try {
91
            $cond = new condition($structure);
91
            $cond = new condition($structure);
Línea 186... Línea 186...
186
    }
186
    }
Línea 187... Línea 187...
187
 
187
 
188
    /**
188
    /**
189
     * Tests the save() function.
189
     * Tests the save() function.
190
     */
190
     */
191
    public function test_save() {
191
    public function test_save(): void {
192
        $structure = (object)array('cf' => 'frogtype', 'op' => condition::OP_IS_EMPTY);
192
        $structure = (object)array('cf' => 'frogtype', 'op' => condition::OP_IS_EMPTY);
193
        $cond = new condition($structure);
193
        $cond = new condition($structure);
194
        $structure->type = 'profile';
194
        $structure->type = 'profile';
Línea 204... Línea 204...
204
    /**
204
    /**
205
     * Tests the is_available function. There is no separate test for
205
     * Tests the is_available function. There is no separate test for
206
     * get_full_information because that function is called from is_available
206
     * get_full_information because that function is called from is_available
207
     * and we test its values here.
207
     * and we test its values here.
208
     */
208
     */
209
    public function test_is_available() {
209
    public function test_is_available(): void {
210
        global $USER, $SITE, $DB;
210
        global $USER, $SITE, $DB;
211
        $this->setAdminUser();
211
        $this->setAdminUser();
212
        $info = new \core_availability\mock_info();
212
        $info = new \core_availability\mock_info();
Línea 213... Línea 213...
213
 
213
 
Línea 312... Línea 312...
312
    /**
312
    /**
313
     * Tests what happens with custom fields that are text areas. These should
313
     * Tests what happens with custom fields that are text areas. These should
314
     * not be offered in the menu because their data is not included in user
314
     * not be offered in the menu because their data is not included in user
315
     * object
315
     * object
316
     */
316
     */
317
    public function test_custom_textarea_field() {
317
    public function test_custom_textarea_field(): void {
318
        global $USER, $SITE, $DB;
318
        global $USER, $SITE, $DB;
319
        $this->setAdminUser();
319
        $this->setAdminUser();
320
        $info = new \core_availability\mock_info();
320
        $info = new \core_availability\mock_info();
Línea 321... Línea 321...
321
 
321
 
Línea 394... Línea 394...
394
    }
394
    }
Línea 395... Línea 395...
395
 
395
 
396
    /**
396
    /**
397
     * Tests the filter_users (bulk checking) function.
397
     * Tests the filter_users (bulk checking) function.
398
     */
398
     */
399
    public function test_filter_users() {
399
    public function test_filter_users(): void {
400
        global $DB, $CFG;
400
        global $DB, $CFG;
401
        $this->resetAfterTest();
401
        $this->resetAfterTest();
Línea 402... Línea 402...
402
        $CFG->enableavailability = true;
402
        $CFG->enableavailability = true;
Línea 441... Línea 441...
441
 
441
 
442
    /**
442
    /**
443
     * Tests getting user list SQL. This is a different test from the above because
443
     * Tests getting user list SQL. This is a different test from the above because
444
     * there is some additional code in this function so more variants need testing.
444
     * there is some additional code in this function so more variants need testing.
445
     */
445
     */
446
    public function test_get_user_list_sql() {
446
    public function test_get_user_list_sql(): void {
447
        global $DB, $CFG;
447
        global $DB, $CFG;
448
        $this->resetAfterTest();
448
        $this->resetAfterTest();
Línea 449... Línea 449...
449
        $CFG->enableavailability = true;
449
        $CFG->enableavailability = true;