Linux aries.aptans.com 4.18.0-348.20.1.lve.1.el8.x86_64 #1 SMP Wed Mar 16 08:45:39 EDT 2022 x86_64
Apache
: 135.181.142.107 | : 172.70.130.22
Cant Read [ /etc/named.conf ]
7.4.33
aja
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
home /
aja /
public_html /
ead /
blocks /
xp /
tests /
[ HOME SHELL ]
Name
Size
Permission
Action
behat
[ DIR ]
drwxr-xr-x
fixtures
[ DIR ]
drwxr-xr-x
base_testcase.php
1.38
KB
-rw-r--r--
config_test.php
15.89
KB
-rw-r--r--
course_world_collection_strate...
5.18
KB
-rw-r--r--
course_world_config_test.php
2.95
KB
-rw-r--r--
course_world_test.php
6.6
KB
-rw-r--r--
filters_test.php
13.89
KB
-rw-r--r--
leaderboard_factory_test.php
13.49
KB
-rw-r--r--
leaderboard_test.php
14.39
KB
-rw-r--r--
privacy_provider_test.php
24.22
KB
-rw-r--r--
rules_test.php
7.04
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : course_world_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/>. /** * Block XP course world test. * * @package block_xp * @copyright 2015 Frédéric Massart - FMCorz.net * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); global $CFG; require_once(__DIR__ . '/base_testcase.php'); require_once(__DIR__ . '/fixtures/events.php'); /** * Course world testcase. * * @package block_xp * @copyright 2015 Frédéric Massart - FMCorz.net * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class block_xp_course_world_testcase extends block_xp_base_testcase { protected function get_world($courseid) { return \block_xp\di::get('course_world_factory')->get_world($courseid); } public function test_reset_data() { global $DB; $c1 = $this->getDataGenerator()->create_course(); $c2 = $this->getDataGenerator()->create_course(); $u1 = $this->getDataGenerator()->create_user(); $u2 = $this->getDataGenerator()->create_user(); $this->getDataGenerator()->enrol_user($u1->id, $c1->id); $this->getDataGenerator()->enrol_user($u2->id, $c1->id); $this->getDataGenerator()->enrol_user($u1->id, $c2->id); $world = $this->get_world($c1->id); $world->get_config()->set_many(['enabled' => true, 'timebetweensameactions' => 0]); $strategy = $world->get_collection_strategy(); $e = \block_xp\event\something_happened::mock(array('crud' => 'c', 'userid' => $u1->id, 'courseid' => $c1->id)); $strategy->collect_event($e); $strategy->collect_event($e); $e = \block_xp\event\something_happened::mock(array('crud' => 'c', 'userid' => $u2->id, 'courseid' => $c1->id)); $strategy->collect_event($e); $strategy->collect_event($e); $world = $this->get_world($c2->id); $world->get_config()->set_many(['enabled' => true, 'timebetweensameactions' => 0]); $strategy = $world->get_collection_strategy(); $e = \block_xp\event\something_happened::mock(array('crud' => 'c', 'userid' => $u1->id, 'courseid' => $c2->id)); $strategy->collect_event($e); $this->assertEquals(2, $DB->count_records('block_xp', array('courseid' => $c1->id))); $this->assertEquals(4, $DB->count_records('block_xp_log', array('courseid' => $c1->id))); $this->assertEquals(1, $DB->count_records('block_xp', array('courseid' => $c2->id))); $this->assertEquals(1, $DB->count_records('block_xp_log', array('courseid' => $c2->id))); $world = $this->get_world($c1->id); $world->get_store()->reset(); $this->assertEquals(0, $DB->count_records('block_xp', array('courseid' => $c1->id))); $this->assertEquals(0, $DB->count_records('block_xp_log', array('courseid' => $c1->id))); $this->assertEquals(1, $DB->count_records('block_xp', array('courseid' => $c2->id))); $this->assertEquals(1, $DB->count_records('block_xp_log', array('courseid' => $c2->id))); } public function test_reset_data_with_groups() { global $DB; $c1 = $this->getDataGenerator()->create_course(); $c2 = $this->getDataGenerator()->create_course(); $u1 = $this->getDataGenerator()->create_user(); $u2 = $this->getDataGenerator()->create_user(); $g1 = $this->getDataGenerator()->create_group(array('courseid' => $c1->id)); $this->getDataGenerator()->enrol_user($u1->id, $c1->id); $this->getDataGenerator()->enrol_user($u2->id, $c1->id); $this->getDataGenerator()->enrol_user($u1->id, $c2->id); $this->getDataGenerator()->create_group_member(array('groupid' => $g1->id, 'userid' => $u1->id)); $world = $this->get_world($c1->id); $world->get_config()->set_many(['enabled' => true, 'timebetweensameactions' => 0]); $strategy = $world->get_collection_strategy(); $e = \block_xp\event\something_happened::mock(array('crud' => 'c', 'userid' => $u1->id, 'courseid' => $c1->id)); $strategy->collect_event($e); $strategy->collect_event($e); $e = \block_xp\event\something_happened::mock(array('crud' => 'c', 'userid' => $u2->id, 'courseid' => $c1->id)); $strategy->collect_event($e); $strategy->collect_event($e); $world = $this->get_world($c2->id); $world->get_config()->set_many(['enabled' => true, 'timebetweensameactions' => 0]); $strategy = $world->get_collection_strategy(); $e = \block_xp\event\something_happened::mock(array('crud' => 'c', 'userid' => $u1->id, 'courseid' => $c2->id)); $strategy->collect_event($e); $this->assertEquals(1, $DB->count_records('block_xp', array('courseid' => $c1->id, 'userid' => $u1->id))); $this->assertEquals(1, $DB->count_records('block_xp', array('courseid' => $c1->id, 'userid' => $u2->id))); $this->assertEquals(2, $DB->count_records('block_xp_log', array('courseid' => $c1->id, 'userid' => $u1->id))); $this->assertEquals(2, $DB->count_records('block_xp_log', array('courseid' => $c1->id, 'userid' => $u2->id))); $this->assertEquals(1, $DB->count_records('block_xp', array('courseid' => $c2->id))); $this->assertEquals(1, $DB->count_records('block_xp_log', array('courseid' => $c2->id))); $world = $this->get_world($c1->id); $world->get_store()->reset_by_group($g1->id); $this->assertEquals(0, $DB->count_records('block_xp', array('courseid' => $c1->id, 'userid' => $u1->id))); $this->assertEquals(1, $DB->count_records('block_xp', array('courseid' => $c1->id, 'userid' => $u2->id))); $this->assertEquals(0, $DB->count_records('block_xp_log', array('courseid' => $c1->id, 'userid' => $u1->id))); $this->assertEquals(2, $DB->count_records('block_xp_log', array('courseid' => $c1->id, 'userid' => $u2->id))); $this->assertEquals(1, $DB->count_records('block_xp', array('courseid' => $c2->id))); $this->assertEquals(1, $DB->count_records('block_xp_log', array('courseid' => $c2->id))); } }
Close