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 | : 3.15.27.146
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 /
[ HOME SHELL ]
Name
Size
Permission
Action
Advisory
[ DIR ]
drwxr-xr-x
Charsets
[ DIR ]
drwxr-xr-x
Command
[ DIR ]
drwxr-xr-x
Config
[ DIR ]
drwxr-xr-x
ConfigStorage
[ DIR ]
drwxr-xr-x
Container
[ DIR ]
drwxr-xr-x
Controllers
[ DIR ]
drwxr-xr-x
Crypto
[ DIR ]
drwxr-xr-x
Database
[ DIR ]
drwxr-xr-x
Dbal
[ DIR ]
drwxr-xr-x
Display
[ DIR ]
drwxr-xr-x
Engines
[ DIR ]
drwxr-xr-x
Error
[ DIR ]
drwxr-xr-x
Export
[ DIR ]
drwxr-xr-x
Gis
[ DIR ]
drwxr-xr-x
Html
[ DIR ]
drwxr-xr-x
Http
[ DIR ]
drwxr-xr-x
Identifiers
[ DIR ]
drwxr-xr-x
Import
[ DIR ]
drwxr-xr-x
Navigation
[ DIR ]
drwxr-xr-x
Partitioning
[ DIR ]
drwxr-xr-x
Plugins
[ DIR ]
drwxr-xr-x
Properties
[ DIR ]
drwxr-xr-x
Query
[ DIR ]
drwxr-xr-x
Replication
[ DIR ]
drwxr-xr-x
Routing
[ DIR ]
drwxr-xr-x
Server
[ DIR ]
drwxr-xr-x
Setup
[ DIR ]
drwxr-xr-x
Stubs
[ DIR ]
drwxr-xr-x
Table
[ DIR ]
drwxr-xr-x
Theme
[ DIR ]
drwxr-xr-x
Tracking
[ DIR ]
drwxr-xr-x
Triggers
[ DIR ]
drwxr-xr-x
Utils
[ DIR ]
drwxr-xr-x
WebAuthn
[ DIR ]
drwxr-xr-x
_data
[ DIR ]
drwxr-xr-x
AbstractTestCase.php
5.3
KB
-rw-r--r--
ApplicationTest.php
1.63
KB
-rw-r--r--
BookmarkTest.php
3.56
KB
-rw-r--r--
BrowseForeignersTest.php
6.29
KB
-rw-r--r--
CacheTest.php
3.02
KB
-rw-r--r--
CharsetsTest.php
5.3
KB
-rw-r--r--
ConfigTest.php
31.22
KB
-rw-r--r--
ConsoleTest.php
1.38
KB
-rw-r--r--
CoreTest.php
23.3
KB
-rw-r--r--
CreateAddFieldTest.php
19.21
KB
-rw-r--r--
DatabaseInterfaceTest.php
29.52
KB
-rw-r--r--
DbTableExistsTest.php
2.9
KB
-rw-r--r--
EncodingTest.php
5.89
KB
-rw-r--r--
EnvironmentTest.php
478
B
-rw-r--r--
FieldHelper.php
1.09
KB
-rw-r--r--
FieldMetadataTest.php
3.54
KB
-rw-r--r--
FileListingTest.php
3.54
KB
-rw-r--r--
FileTest.php
2.02
KB
-rw-r--r--
FlashMessagesTest.php
1.96
KB
-rw-r--r--
FontTest.php
6.13
KB
-rw-r--r--
FooterTest.php
5.19
KB
-rw-r--r--
GitTest.php
15.08
KB
-rw-r--r--
HeaderTest.php
11.05
KB
-rw-r--r--
IndexColumnTest.php
2.73
KB
-rw-r--r--
IndexTest.php
4.18
KB
-rw-r--r--
InsertEditTest.php
80.72
KB
-rw-r--r--
IpAllowDenyTest.php
6.62
KB
-rw-r--r--
LanguageTest.php
8.44
KB
-rw-r--r--
LinterTest.php
3.57
KB
-rw-r--r--
ListDatabaseTest.php
2.26
KB
-rw-r--r--
LoggingTest.php
570
B
-rw-r--r--
MenuTest.php
1.63
KB
-rw-r--r--
MessageTest.php
14.44
KB
-rw-r--r--
MimeTest.php
990
B
-rw-r--r--
NormalizationTest.php
15.38
KB
-rw-r--r--
OpenDocumentTest.php
1.67
KB
-rw-r--r--
OperationsTest.php
2.19
KB
-rw-r--r--
ParseAnalyzeTest.php
2.1
KB
-rw-r--r--
PdfTest.php
1.4
KB
-rw-r--r--
PluginsTest.php
4.69
KB
-rw-r--r--
ProfilingTest.php
730
B
-rw-r--r--
ResponseRendererTest.php
1.71
KB
-rw-r--r--
SanitizeTest.php
6.99
KB
-rw-r--r--
ScriptsTest.php
3.66
KB
-rw-r--r--
SessionTest.php
741
B
-rw-r--r--
ShowGrantsTest.php
1.78
KB
-rw-r--r--
SqlQueryFormTest.php
5.85
KB
-rw-r--r--
SqlTest.php
30.76
KB
-rw-r--r--
StorageEngineTest.php
18.19
KB
-rw-r--r--
SystemDatabaseTest.php
4.72
KB
-rw-r--r--
TemplateTest.php
5.61
KB
-rw-r--r--
TransformationsTest.php
10.52
KB
-rw-r--r--
TwoFactorTest.php
21.18
KB
-rw-r--r--
TypesByDatabaseVersionTest.php
31.86
KB
-rw-r--r--
TypesTest.php
20.45
KB
-rw-r--r--
UniqueConditionTest.php
13.26
KB
-rw-r--r--
UrlRedirectorTest.php
1.48
KB
-rw-r--r--
UrlTest.php
8.56
KB
-rw-r--r--
UserPasswordTest.php
2.5
KB
-rw-r--r--
UserPreferencesTest.php
12.02
KB
-rw-r--r--
UserPrivilegesFactoryTest.php
5.82
KB
-rw-r--r--
UtilTest.php
55.46
KB
-rw-r--r--
VersionInformationTest.php
9.62
KB
-rw-r--r--
VersionTest.php
1.25
KB
-rw-r--r--
ZipExtensionTest.php
5.31
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : MessageTest.php
<?php declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\Message; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use function md5; #[CoversClass(Message::class)] class MessageTest extends AbstractTestCase { protected Message $object; /** * Sets up the fixture, for example, opens a network connection. * This method is called before a test is executed. */ protected function setUp(): void { parent::setUp(); $this->object = new Message(); } /** * to String casting test */ public function testToString(): void { $this->object->setMessage('test<&>'); self::assertSame('test<&>', (string) $this->object); } /** * test success method */ public function testSuccess(): void { $this->object = new Message('test<&>', Message::SUCCESS); self::assertEquals($this->object, Message::success('test<&>')); self::assertSame( 'Your SQL query has been executed successfully.', Message::success()->getString(), ); } /** * test error method */ public function testError(): void { $this->object = new Message('test<&>', Message::ERROR); self::assertEquals($this->object, Message::error('test<&>')); self::assertSame('Error', Message::error()->getString()); } /** * test notice method */ public function testNotice(): void { $this->object = new Message('test<&>', Message::NOTICE); self::assertEquals($this->object, Message::notice('test<&>')); } /** * test rawError method */ public function testRawError(): void { $this->object = new Message('', Message::ERROR); $this->object->setMessage('test<&>'); $this->object->setBBCode(false); self::assertEquals($this->object, Message::rawError('test<&>')); } /** * test rawNotice method */ public function testRawNotice(): void { $this->object = new Message('', Message::NOTICE); $this->object->setMessage('test<&>'); $this->object->setBBCode(false); self::assertEquals($this->object, Message::rawNotice('test<&>')); } /** * test rawSuccess method */ public function testRawSuccess(): void { $this->object = new Message('', Message::SUCCESS); $this->object->setMessage('test<&>'); $this->object->setBBCode(false); self::assertEquals($this->object, Message::rawSuccess('test<&>')); } /** * testing isSuccess method */ public function testIsSuccess(): void { self::assertFalse($this->object->isSuccess()); $this->object->setType(Message::SUCCESS); self::assertTrue($this->object->isSuccess()); } /** * testing isNotice method */ public function testIsNotice(): void { self::assertTrue($this->object->isNotice()); $this->object->setType(Message::ERROR); self::assertFalse($this->object->isNotice()); $this->object->setType(Message::NOTICE); self::assertTrue($this->object->isNotice()); } /** * testing isError method */ public function testIsError(): void { self::assertFalse($this->object->isError()); $this->object->setType(Message::ERROR); self::assertTrue($this->object->isError()); } /** * testing setter of message */ public function testSetMessage(): void { $this->object->setMessage('test&<>'); self::assertSame('test&<>', $this->object->getMessage()); } /** * testing setter of string */ public function testSetString(): void { $this->object->setString('test&<>'); self::assertSame('test&<>', $this->object->getString()); } /** * testing add param method */ public function testAddParam(): void { $this->object->addParam(Message::notice('test')); self::assertEquals( [Message::notice('test')], $this->object->getParams(), ); $this->object->addParam('test'); self::assertEquals( [Message::notice('test'), 'test'], $this->object->getParams(), ); $this->object->addParam('test'); self::assertEquals( [Message::notice('test'), 'test', Message::notice('test')], $this->object->getParams(), ); } /** * Test adding html markup */ public function testAddParamHtml(): void { $this->object->setMessage('Hello %s%s%s'); $this->object->addParamHtml('<a href="">'); $this->object->addParam('user<>'); $this->object->addParamHtml('</a>'); self::assertSame( 'Hello <a href="">user<></a>', $this->object->getMessage(), ); } /** * testing add string method */ public function testAddString(): void { $this->object->addText('test', '*'); self::assertEquals( ['*', Message::notice('test')], $this->object->getAddedMessages(), ); $this->object->addText('test', ''); self::assertEquals( ['*', Message::notice('test'), Message::notice('test')], $this->object->getAddedMessages(), ); } /** * testing add message method */ public function testAddMessage(): void { $this->object->addText('test<>', ''); self::assertEquals( [Message::notice('test<>')], $this->object->getAddedMessages(), ); $this->object->addHtml('<b>test</b>'); self::assertEquals( [Message::notice('test<>'), ' ', Message::rawNotice('<b>test</b>')], $this->object->getAddedMessages(), ); $this->object->addMessage(Message::notice('test<>')); self::assertSame( 'test<> <b>test</b> test<>', $this->object->getMessage(), ); } /** * testing add messages method */ public function testAddMessages(): void { $messages = []; $messages[] = new Message('Test1'); $messages[] = new Message('PMA_Test2', Message::ERROR); $messages[] = new Message('Test3'); $this->object->addMessages($messages, ''); self::assertEquals( [Message::notice('Test1'), Message::error('PMA_Test2'), Message::notice('Test3')], $this->object->getAddedMessages(), ); } /** * testing add messages method */ public function testAddMessagesString(): void { $messages = ['test1', 'test<b>', 'test2']; $this->object->addMessagesString($messages, ''); self::assertEquals( [Message::notice('test1'), Message::notice('test<b>'), Message::notice('test2')], $this->object->getAddedMessages(), ); self::assertSame( 'test1test<b>test2', $this->object->getMessage(), ); } /** * testing setter of params */ public function testSetParams(): void { $this->object->setParams(['test&<>']); self::assertSame(['test&<>'], $this->object->getParams()); } /** * testing getHash method */ public function testGetHash(): void { $this->object->setString('<&>test'); $this->object->setMessage('<&>test'); self::assertSame( md5(Message::NOTICE . '<&>test<&>test'), $this->object->getHash(), ); } /** * getMessage test - with empty message and with non-empty string - * not key in globals additional params are defined */ public function testGetMessageWithoutMessageWithStringWithParams(): void { $this->object->setMessage(''); $this->object->setString('test string %s %s'); $this->object->addParam('test param 1'); $this->object->addParam('test param 2'); self::assertSame( 'test string test param 1 test param 2', $this->object->getMessage(), ); } /** * getMessage test - with empty message and with empty string */ public function testGetMessageWithoutMessageWithEmptyString(): void { $this->object->setMessage(''); $this->object->setString(''); self::assertSame('', $this->object->getMessage()); } /** * getMessage test - message is defined * message with BBCode defined */ public function testGetMessageWithMessageWithBBCode(): void { $this->object->setMessage('[kbd]test[/kbd] [doc@cfg_Example]test[/doc]'); self::assertSame( '<kbd>test</kbd> <a href="index.php?route=/url&url=https%3A%2F%2Fdocs.phpmyadmin.' . 'net%2Fen%2Flatest%2Fconfig.html%23cfg_Example"' . ' target="documentation">test</a>', $this->object->getMessage(), ); } /** * getLevel test */ public function testGetLevel(): void { self::assertSame('notice', $this->object->getLevel()); $this->object->setType(Message::SUCCESS); self::assertSame('success', $this->object->getLevel()); $this->object->setType(Message::ERROR); self::assertSame('error', $this->object->getLevel()); } /** * getDisplay test */ public function testGetDisplay(): void { self::assertFalse($this->object->isDisplayed()); $this->object->setMessage('Test Message'); self::assertSame( '<div class="alert alert-primary" role="alert">' . "\n" . ' <img src="themes/dot.gif" title="" alt="" class="icon ic_s_notice"> Test Message' . "\n" . '</div>' . "\n", $this->object->getDisplay(), ); self::assertTrue($this->object->isDisplayed()); } /** * isDisplayed test */ public function testIsDisplayed(): void { self::assertFalse($this->object->isDisplayed(false)); self::assertTrue($this->object->isDisplayed(true)); self::assertTrue($this->object->isDisplayed(false)); } /** * Data provider for testAffectedRows * * @return mixed[] Test-data */ public static function providerAffectedRows(): array { return [ [ 1, '<div class="alert alert-primary" role="alert">' . "\n" . ' <img src="themes/dot.gif" title="" alt="" class="icon ic_s_notice"> 1 row affected.' . "\n" . '</div>' . "\n", ], [ 2, '<div class="alert alert-primary" role="alert">' . "\n" . ' <img src="themes/dot.gif" title="" alt="" class="icon ic_s_notice"> 2 rows affected.' . "\n" . '</div>' . "\n", ], [ 10000, '<div class="alert alert-primary" role="alert">' . "\n" . ' <img src="themes/dot.gif" title="" alt="" class="icon ic_s_notice"> 10000 rows affected.' . "\n" . '</div>' . "\n", ], ]; } /** * Test for getMessageForAffectedRows() method * * @param int $rows Number of rows * @param string $output Expected string */ #[DataProvider('providerAffectedRows')] public function testAffectedRows(int $rows, string $output): void { $this->object = new Message(); $this->object->addMessage(Message::getMessageForAffectedRows($rows)); self::assertSame($output, $this->object->getDisplay()); } /** * Data provider for testInsertedRows * * @return mixed[] Test-data */ public static function providerInsertedRows(): array { return [ [ 1, '<div class="alert alert-primary" role="alert">' . "\n" . ' <img src="themes/dot.gif" title="" alt="" class="icon ic_s_notice"> 1 row inserted.' . "\n" . '</div>' . "\n", ], [ 2, '<div class="alert alert-primary" role="alert">' . "\n" . ' <img src="themes/dot.gif" title="" alt="" class="icon ic_s_notice"> 2 rows inserted.' . "\n" . '</div>' . "\n", ], [ 100000, '<div class="alert alert-primary" role="alert">' . "\n" . ' <img src="themes/dot.gif" title="" alt="" class="icon ic_s_notice"> 100000 rows inserted.' . "\n" . '</div>' . "\n", ], ]; } /** * Test for getMessageForInsertedRows() method * * @param int $rows Number of rows * @param string $output Expected string */ #[DataProvider('providerInsertedRows')] public function testInsertedRows(int $rows, string $output): void { $this->object = new Message(); $this->object->addMessage(Message::getMessageForInsertedRows($rows)); self::assertSame($output, $this->object->getDisplay()); } /** * Data provider for testDeletedRows * * @return mixed[] Test-data */ public static function providerDeletedRows(): array { return [ [ 1, '<div class="alert alert-primary" role="alert">' . "\n" . ' <img src="themes/dot.gif" title="" alt="" class="icon ic_s_notice"> 1 row deleted.' . "\n" . '</div>' . "\n", ], [ 2, '<div class="alert alert-primary" role="alert">' . "\n" . ' <img src="themes/dot.gif" title="" alt="" class="icon ic_s_notice"> 2 rows deleted.' . "\n" . '</div>' . "\n", ], [ 500000, '<div class="alert alert-primary" role="alert">' . "\n" . ' <img src="themes/dot.gif" title="" alt="" class="icon ic_s_notice"> 500000 rows deleted.' . "\n" . '</div>' . "\n", ], ]; } /** * Test for getMessageForDeletedRows() method * * @param int $rows Number of rows * @param string $output Expected string */ #[DataProvider('providerDeletedRows')] public function testDeletedRows(int $rows, string $output): void { $this->object = new Message(); $this->object->addMessage(Message::getMessageForDeletedRows($rows)); self::assertSame($output, $this->object->getDisplay()); } }
Close