Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 124... Línea 124...
124
    }
124
    }
Línea 125... Línea 125...
125
 
125
 
126
    /**
126
    /**
127
     * Test the get_this_slot() method
127
     * Test the get_this_slot() method
128
     */
128
     */
129
    public function test_get_this_slot() {
129
    public function test_get_this_slot(): void {
130
        $this->set_quiz_slots();
130
        $this->set_quiz_slots();
131
        $actual = [];
131
        $actual = [];
132
        $expected = $this->repaginate->get_slots_by_slot_number();
132
        $expected = $this->repaginate->get_slots_by_slot_number();
Línea 136... Línea 136...
136
        $slotnumber = 5;
136
        $slotnumber = 5;
137
        $thisslot = $this->repaginate->get_this_slot($this->quizslots, $slotnumber);
137
        $thisslot = $this->repaginate->get_this_slot($this->quizslots, $slotnumber);
138
        $this->assertEquals($slotsbyno[$slotnumber], $thisslot);
138
        $this->assertEquals($slotsbyno[$slotnumber], $thisslot);
139
    }
139
    }
Línea 140... Línea 140...
140
 
140
 
141
    public function test_get_slots_by_slotnumber() {
141
    public function test_get_slots_by_slotnumber(): void {
142
        $this->set_quiz_slots();
142
        $this->set_quiz_slots();
143
        $expected = [];
143
        $expected = [];
144
        $actual = $this->repaginate->get_slots_by_slot_number();
144
        $actual = $this->repaginate->get_slots_by_slot_number();
Línea 149... Línea 149...
149
        }
149
        }
150
        $actual = $this->repaginate->get_slots_by_slot_number($this->quizslots);
150
        $actual = $this->repaginate->get_slots_by_slot_number($this->quizslots);
151
        $this->assertEquals($expected, $actual);
151
        $this->assertEquals($expected, $actual);
152
    }
152
    }
Línea 153... Línea 153...
153
 
153
 
154
    public function test_get_slots_by_slotid() {
154
    public function test_get_slots_by_slotid(): void {
155
        $this->set_quiz_slots();
155
        $this->set_quiz_slots();
156
        $actual = $this->repaginate->get_slots_by_slotid();
156
        $actual = $this->repaginate->get_slots_by_slotid();
Línea 157... Línea 157...
157
        $this->assertEquals([], $actual);
157
        $this->assertEquals([], $actual);
158
 
158
 
159
        $slotsbyno = $this->repaginate->get_slots_by_slot_number($this->quizslots);
159
        $slotsbyno = $this->repaginate->get_slots_by_slot_number($this->quizslots);
160
        $actual = $this->repaginate->get_slots_by_slotid($slotsbyno);
160
        $actual = $this->repaginate->get_slots_by_slotid($slotsbyno);
Línea 161... Línea 161...
161
        $this->assertEquals($this->quizslots, $actual);
161
        $this->assertEquals($this->quizslots, $actual);
162
    }
162
    }
Línea 163... Línea 163...
163
 
163
 
164
    public function test_repaginate_n_questions_per_page() {
164
    public function test_repaginate_n_questions_per_page(): void {
165
        $this->set_quiz_slots();
165
        $this->set_quiz_slots();
Línea 241... Línea 241...
241
        }
241
        }
242
        $actual = $this->repaginate->repaginate_n_question_per_page($this->quizslots, 1);
242
        $actual = $this->repaginate->repaginate_n_question_per_page($this->quizslots, 1);
243
        $this->assertEquals($expected, $actual);
243
        $this->assertEquals($expected, $actual);
244
    }
244
    }
Línea 245... Línea 245...
245
 
245
 
246
    public function test_repaginate_this_slot() {
246
    public function test_repaginate_this_slot(): void {
247
        $this->set_quiz_slots();
247
        $this->set_quiz_slots();
248
        $slotsbyslotno = $this->repaginate->get_slots_by_slot_number($this->quizslots);
248
        $slotsbyslotno = $this->repaginate->get_slots_by_slot_number($this->quizslots);
249
        $slotnumber = 3;
249
        $slotnumber = 3;
250
        $newpagenumber = 2;
250
        $newpagenumber = 2;
Línea 253... Línea 253...
253
        $expected = $thisslot;
253
        $expected = $thisslot;
254
        $actual = $this->repaginate->repaginate_this_slot($slotsbyslotno[3], $newpagenumber);
254
        $actual = $this->repaginate->repaginate_this_slot($slotsbyslotno[3], $newpagenumber);
255
        $this->assertEquals($expected, $actual);
255
        $this->assertEquals($expected, $actual);
256
    }
256
    }
Línea 257... Línea 257...
257
 
257
 
258
    public function test_repaginate_the_rest() {
258
    public function test_repaginate_the_rest(): void {
259
        $this->set_quiz_slots();
259
        $this->set_quiz_slots();
260
        $slotfrom = 1;
260
        $slotfrom = 1;
261
        $type = repaginate::LINK;
261
        $type = repaginate::LINK;
262
        $expected = [];
262
        $expected = [];