Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 36... Línea 36...
36
    }
36
    }
Línea 37... Línea 37...
37
 
37
 
38
    /**
38
    /**
39
     * Tests constructing and using date condition as part of tree.
39
     * Tests constructing and using date condition as part of tree.
40
     */
40
     */
41
    public function test_in_tree() {
41
    public function test_in_tree(): void {
42
        global $SITE, $USER, $CFG;
42
        global $SITE, $USER, $CFG;
43
        $this->resetAfterTest();
43
        $this->resetAfterTest();
Línea 44... Línea 44...
44
        $this->setAdminUser();
44
        $this->setAdminUser();
Línea 78... Línea 78...
78
 
78
 
79
    /**
79
    /**
80
     * Tests the constructor including error conditions. Also tests the
80
     * Tests the constructor including error conditions. Also tests the
81
     * string conversion feature (intended for debugging only).
81
     * string conversion feature (intended for debugging only).
82
     */
82
     */
83
    public function test_constructor() {
83
    public function test_constructor(): void {
84
        // No parameters.
84
        // No parameters.
85
        $structure = (object)array();
85
        $structure = (object)array();
86
        try {
86
        try {
87
            $date = new condition($structure);
87
            $date = new condition($structure);
Línea 127... Línea 127...
127
    }
127
    }
Línea 128... Línea 128...
128
 
128
 
129
    /**
129
    /**
130
     * Tests the save() function.
130
     * Tests the save() function.
131
     */
131
     */
132
    public function test_save() {
132
    public function test_save(): void {
133
        $structure = (object)array('d' => '>=', 't' => 12345);
133
        $structure = (object)array('d' => '>=', 't' => 12345);
134
        $cond = new condition($structure);
134
        $cond = new condition($structure);
135
        $structure->type = 'date';
135
        $structure->type = 'date';
136
        $this->assertEquals($structure, $cond->save());
136
        $this->assertEquals($structure, $cond->save());
Línea 137... Línea 137...
137
    }
137
    }
138
 
138
 
139
    /**
139
    /**
140
     * Tests the is_available() and is_available_to_all() functions.
140
     * Tests the is_available() and is_available_to_all() functions.
141
     */
141
     */
Línea 142... Línea 142...
142
    public function test_is_available() {
142
    public function test_is_available(): void {
143
        global $SITE, $USER;
143
        global $SITE, $USER;
Línea 168... Línea 168...
168
    }
168
    }
Línea 169... Línea 169...
169
 
169
 
170
    /**
170
    /**
171
     * Tests the get_description and get_standalone_description functions.
171
     * Tests the get_description and get_standalone_description functions.
172
     */
172
     */
173
    public function test_get_description() {
173
    public function test_get_description(): void {
Línea 174... Línea 174...
174
        global $SITE, $CFG;
174
        global $SITE, $CFG;
175
 
175
 
Línea 230... Línea 230...
230
    }
230
    }
Línea 231... Línea 231...
231
 
231
 
232
    /**
232
    /**
233
     * Tests the update_all_dates function.
233
     * Tests the update_all_dates function.
234
     */
234
     */
235
    public function test_update_all_dates() {
235
    public function test_update_all_dates(): void {
236
        global $DB;
236
        global $DB;
Línea 237... Línea 237...
237
        $this->resetAfterTest();
237
        $this->resetAfterTest();
238
 
238