Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 11
Línea 148... Línea 148...
148
    }
148
    }
Línea 149... Línea 149...
149
 
149
 
150
    /**
150
    /**
151
     * Test backup and restore when no seb.
151
     * Test backup and restore when no seb.
152
     */
152
     */
153
    public function test_backup_restore_no_seb() {
153
    public function test_backup_restore_no_seb(): void {
154
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_NO);
154
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_NO);
Línea 155... Línea 155...
155
        $this->assertEquals(0, seb_quiz_settings::count_records());
155
        $this->assertEquals(0, seb_quiz_settings::count_records());
156
 
156
 
157
        $this->backup_and_restore_quiz();
157
        $this->backup_and_restore_quiz();
Línea 158... Línea 158...
158
        $this->assertEquals(0, seb_quiz_settings::count_records());
158
        $this->assertEquals(0, seb_quiz_settings::count_records());
159
    }
159
    }
160
 
160
 
161
    /**
161
    /**
162
     * Test backup and restore when manually configured.
162
     * Test backup and restore when manually configured.
Línea 163... Línea 163...
163
     */
163
     */
164
    public function test_backup_restore_manual_config() {
164
    public function test_backup_restore_manual_config(): void {
165
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
165
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
Línea 176... Línea 176...
176
    }
176
    }
Línea 177... Línea 177...
177
 
177
 
178
    /**
178
    /**
179
     * Test backup and restore when using template.
179
     * Test backup and restore when using template.
180
     */
180
     */
181
    public function test_backup_restore_template_config() {
181
    public function test_backup_restore_template_config(): void {
Línea 182... Línea 182...
182
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
182
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
183
 
183
 
184
        $expected = seb_quiz_settings::get_record(['quizid' => $this->quiz->id]);
184
        $expected = seb_quiz_settings::get_record(['quizid' => $this->quiz->id]);
Línea 194... Línea 194...
194
    }
194
    }
Línea 195... Línea 195...
195
 
195
 
196
    /**
196
    /**
197
     * Test backup and restore when using uploaded file.
197
     * Test backup and restore when using uploaded file.
198
     */
198
     */
199
    public function test_backup_restore_uploaded_config() {
199
    public function test_backup_restore_uploaded_config(): void {
Línea 200... Línea 200...
200
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
200
        $this->quiz = $this->create_test_quiz($this->course, settings_provider::USE_SEB_CONFIG_MANUALLY);
201
 
201
 
202
        $expected = seb_quiz_settings::get_record(['quizid' => $this->quiz->id]);
202
        $expected = seb_quiz_settings::get_record(['quizid' => $this->quiz->id]);
Línea 218... Línea 218...
218
 
218
 
219
    /**
219
    /**
220
     * No new template should be restored if restoring to a different site,
220
     * No new template should be restored if restoring to a different site,
221
     * but the template with  the same name and content exists..
221
     * but the template with  the same name and content exists..
222
     */
222
     */
223
    public function test_restore_template_to_a_different_site_when_the_same_template_exists() {
223
    public function test_restore_template_to_a_different_site_when_the_same_template_exists(): void {
224
        $this->create_quiz_with_template();
224
        $this->create_quiz_with_template();
Línea 225... Línea 225...
225
        $backupid = $this->backup_quiz();
225
        $backupid = $this->backup_quiz();
226
 
226
 
Línea 237... Línea 237...
237
 
237
 
238
    /**
238
    /**
239
     * A new template should be restored if restoring to a different site, but existing template
239
     * A new template should be restored if restoring to a different site, but existing template
240
     * has the same content, but different name.
240
     * has the same content, but different name.
241
     */
241
     */
242
    public function test_restore_template_to_a_different_site_when_the_same_content_but_different_name() {
242
    public function test_restore_template_to_a_different_site_when_the_same_content_but_different_name(): void {
243
        $this->create_quiz_with_template();
243
        $this->create_quiz_with_template();
Línea 244... Línea 244...
244
        $backupid = $this->backup_quiz();
244
        $backupid = $this->backup_quiz();
245
 
245
 
Línea 259... Línea 259...
259
 
259
 
260
    /**
260
    /**
261
     * A new template should be restored if restoring to a different site, but existing template
261
     * A new template should be restored if restoring to a different site, but existing template
262
     * has the same name, but different content.
262
     * has the same name, but different content.
263
     */
263
     */
264
    public function test_restore_template_to_a_different_site_when_the_same_name_but_different_content() {
264
    public function test_restore_template_to_a_different_site_when_the_same_name_but_different_content(): void {
Línea 265... Línea 265...
265
        global $CFG;
265
        global $CFG;
266
 
266