Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 31... Línea 31...
31
 * @copyright  2012 Frédéric Massart
31
 * @copyright  2012 Frédéric Massart
32
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
32
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
33
 */
33
 */
34
class courserequest_test extends \advanced_testcase {
34
class courserequest_test extends \advanced_testcase {
Línea 35... Línea 35...
35
 
35
 
36
    public function test_create_request() {
36
    public function test_create_request(): void {
37
        global $DB, $USER;
37
        global $DB, $USER;
Línea 38... Línea 38...
38
        $this->resetAfterTest(true);
38
        $this->resetAfterTest(true);
39
 
39
 
Línea 76... Línea 76...
76
        $data->category = $cat1->id;
76
        $data->category = $cat1->id;
77
        $cr = course_request::create($data);
77
        $cr = course_request::create($data);
78
        $this->assertEquals($cat1->id, $cr->category);
78
        $this->assertEquals($cat1->id, $cr->category);
79
    }
79
    }
Línea 80... Línea 80...
80
 
80
 
81
    public function test_approve_request() {
81
    public function test_approve_request(): void {
82
        global $DB;
82
        global $DB;
83
        $this->resetAfterTest(true);
83
        $this->resetAfterTest(true);
Línea 84... Línea 84...
84
        $this->preventResetByRollback();
84
        $this->preventResetByRollback();
Línea 137... Línea 137...
137
        $sink->close();
137
        $sink->close();
138
        $course = $DB->get_record('course', array('id' => $id));
138
        $course = $DB->get_record('course', array('id' => $id));
139
        $this->assertEquals($data->category, $course->category);
139
        $this->assertEquals($data->category, $course->category);
140
    }
140
    }
Línea 141... Línea 141...
141
 
141
 
142
    public function test_reject_request() {
142
    public function test_reject_request(): void {
143
        global $DB;
143
        global $DB;
144
        $this->resetAfterTest(true);
144
        $this->resetAfterTest(true);
Línea 145... Línea 145...
145
        $this->preventResetByRollback();
145
        $this->preventResetByRollback();