Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 59... Línea 59...
59
     * Test the grade letter created event.
59
     * Test the grade letter created event.
60
     *
60
     *
61
     * There is no external API for triggering this event, so the unit test will simply
61
     * There is no external API for triggering this event, so the unit test will simply
62
     * create and trigger the event and ensure the data is returned as expected.
62
     * create and trigger the event and ensure the data is returned as expected.
63
     */
63
     */
64
    public function test_grade_letter_created() {
64
    public function test_grade_letter_created(): void {
65
        // Create a grade letter created event.
65
        // Create a grade letter created event.
66
        $event = \core\event\grade_letter_created::create(array(
66
        $event = \core\event\grade_letter_created::create(array(
67
            'objectid' => 10,
67
            'objectid' => 10,
68
            'context' => \context_course::instance($this->course->id)
68
            'context' => \context_course::instance($this->course->id)
69
        ));
69
        ));
Línea 83... Línea 83...
83
     * Test the grade letter deleted event.
83
     * Test the grade letter deleted event.
84
     *
84
     *
85
     * There is no external API for triggering this event, so the unit test will simply
85
     * There is no external API for triggering this event, so the unit test will simply
86
     * create and trigger the event and ensure the data is returned as expected.
86
     * create and trigger the event and ensure the data is returned as expected.
87
     */
87
     */
88
    public function test_grade_letter_deleted() {
88
    public function test_grade_letter_deleted(): void {
89
        // Create a grade letter deleted event.
89
        // Create a grade letter deleted event.
90
        $event = \core\event\grade_letter_deleted::create(array(
90
        $event = \core\event\grade_letter_deleted::create(array(
91
            'objectid' => 10,
91
            'objectid' => 10,
92
            'context' => \context_course::instance($this->course->id)
92
            'context' => \context_course::instance($this->course->id)
93
        ));
93
        ));
Línea 107... Línea 107...
107
     * Test the grade letter updated event.
107
     * Test the grade letter updated event.
108
     *
108
     *
109
     * There is no external API for triggering this event, so the unit test will simply
109
     * There is no external API for triggering this event, so the unit test will simply
110
     * create and trigger the event and ensure the data is returned as expected.
110
     * create and trigger the event and ensure the data is returned as expected.
111
     */
111
     */
112
    public function test_grade_letter_updated() {
112
    public function test_grade_letter_updated(): void {
113
        // Create a grade letter updated event.
113
        // Create a grade letter updated event.
114
        $event = \core\event\grade_letter_updated::create(array(
114
        $event = \core\event\grade_letter_updated::create(array(
115
            'objectid' => 10,
115
            'objectid' => 10,
116
            'context' => \context_course::instance($this->course->id)
116
            'context' => \context_course::instance($this->course->id)
117
        ));
117
        ));
Línea 128... Línea 128...
128
    }
128
    }
Línea 129... Línea 129...
129
 
129
 
130
    /**
130
    /**
131
     * Test the scale created event.
131
     * Test the scale created event.
132
     */
132
     */
133
    public function test_scale_created() {
133
    public function test_scale_created(): void {
134
        $gradescale = new \grade_scale();
134
        $gradescale = new \grade_scale();
135
        $gradescale->name        = 'unittestscale3';
135
        $gradescale->name        = 'unittestscale3';
136
        $gradescale->courseid    = $this->course->id;
136
        $gradescale->courseid    = $this->course->id;
137
        $gradescale->userid      = 317;
137
        $gradescale->userid      = 317;
Línea 154... Línea 154...
154
    }
154
    }
Línea 155... Línea 155...
155
 
155
 
156
    /**
156
    /**
157
     * Test the scale deleted event.
157
     * Test the scale deleted event.
158
     */
158
     */
159
    public function test_scale_deleted() {
159
    public function test_scale_deleted(): void {
160
        $gradescale = new \grade_scale();
160
        $gradescale = new \grade_scale();
161
        $gradescale->name        = 'unittestscale3';
161
        $gradescale->name        = 'unittestscale3';
162
        $gradescale->courseid    = $this->course->id;
162
        $gradescale->courseid    = $this->course->id;
163
        $gradescale->userid      = 317;
163
        $gradescale->userid      = 317;
Línea 177... Línea 177...
177
    }
177
    }
Línea 178... Línea 178...
178
 
178
 
179
    /**
179
    /**
180
     * Test the scale updated event.
180
     * Test the scale updated event.
181
     */
181
     */
182
    public function test_scale_updated() {
182
    public function test_scale_updated(): void {
183
        $gradescale = new \grade_scale();
183
        $gradescale = new \grade_scale();
184
        $gradescale->name        = 'unittestscale3';
184
        $gradescale->name        = 'unittestscale3';
185
        $gradescale->courseid    = $this->course->id;
185
        $gradescale->courseid    = $this->course->id;
186
        $gradescale->userid      = 317;
186
        $gradescale->userid      = 317;