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.218.102.138
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 : VersionInformationTest.php
<?php declare(strict_types=1); namespace PhpMyAdmin\Tests; use PhpMyAdmin\Config; use PhpMyAdmin\Release; use PhpMyAdmin\VersionInformation; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; use PHPUnit\Framework\Attributes\Group; #[CoversClass(VersionInformation::class)] #[CoversClass(Release::class)] class VersionInformationTest extends AbstractTestCase { /** @var Release[] */ private array $releases; /** * 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->setProxySettings(); $this->releases = []; $release = new Release('4.4.14.1', '2015-09-08', '>=5.3,<7.1', '>=5.5'); $this->releases[] = $release; $release = new Release('4.4.13.3', '2015-09-09', '>=5.3,<7.0', '>=5.5'); $this->releases[] = $release; $release = new Release('4.0.10.10', '2015-05-13', '>=5.2,<5.3', '>=5.0'); $this->releases[] = $release; } /** * Test version checking */ #[Group('large')] #[Group('network')] public function testGetLatestVersion(): void { $this->setProxySettings(); Config::getInstance()->settings['VersionCheck'] = true; unset($_SESSION['cache']['version_check']); $versionInformation = new VersionInformation(); $version = $versionInformation->getLatestVersions(); self::assertIsArray($version); self::assertNotEmpty($version); } /** * Test version to int conversion. * * @param string $version Version string * @param int $numeric Integer matching version */ #[DataProvider('dataVersions')] public function testVersionToInt(string $version, int $numeric): void { $versionInformation = new VersionInformation(); self::assertSame( $numeric, $versionInformation->versionToInt($version), ); } /** * Data provider for version parsing * * @return mixed[] */ public static function dataVersions(): array { return [ ['1.0.0', 1000050], ['2.0.0.2-dev', 2000002], ['3.4.2.1', 3040251], ['3.4.2-dev3', 3040203], ['3.4.2-dev', 3040200], ['3.4.2-pl', 3040260], ['3.4.2-pl3', 3040263], ['4.4.2-rc22', 4040252], ['4.4.2-rc', 4040230], ['4.4.22-beta22', 4042242], ['4.4.22-beta', 4042220], ['4.4.21-alpha22', 4042132], ['4.4.20-alpha', 4042010], ['4.40.20-alpha-dev', 4402010], ['4.4a', 4000050], ['4.4.4-test', 4040400], ['4.1.0', 4010050], ['4.0.1.3', 4000153], ['4.1-dev', 4010000], ]; } /** * Tests getLatestCompatibleVersion() when there is only one server configured */ public function testGetLatestCompatibleVersionWithSingleServer(): void { Config::getInstance()->settings['Servers'] = [[]]; $mockVersionInfo = $this->createPartialMock(VersionInformation::class, ['getPHPVersion', 'getMySQLVersion']); $mockVersionInfo->expects(self::exactly(6))->method('getPHPVersion')->willReturn('5.6.0'); $mockVersionInfo->expects(self::exactly(2))->method('getMySQLVersion')->willReturn('5.5.0'); $compatible = $mockVersionInfo->getLatestCompatibleVersion($this->releases); self::assertInstanceOf(Release::class, $compatible); self::assertSame('4.4.14.1', $compatible->version); } /** * Tests getLatestCompatibleVersion() when there are multiple servers configured */ public function testGetLatestCompatibleVersionWithMultipleServers(): void { Config::getInstance()->settings['Servers'] = [[], []]; $mockVersionInfo = $this->createPartialMock(VersionInformation::class, ['getPHPVersion', 'getMySQLVersion']); $mockVersionInfo->expects(self::exactly(6))->method('getPHPVersion')->willReturn('5.6.0'); $mockVersionInfo->expects(self::never())->method('getMySQLVersion'); $compatible = $mockVersionInfo->getLatestCompatibleVersion($this->releases); self::assertInstanceOf(Release::class, $compatible); self::assertSame('4.4.14.1', $compatible->version); } /** * Tests getLatestCompatibleVersion() with an old PHP version */ public function testGetLatestCompatibleVersionWithOldPHPVersion(): void { Config::getInstance()->settings['Servers'] = [[], []]; $mockVersionInfo = $this->createPartialMock(VersionInformation::class, ['getPHPVersion', 'getMySQLVersion']); $mockVersionInfo->expects(self::exactly(4))->method('getPHPVersion')->willReturn('5.2.1'); $mockVersionInfo->expects(self::never())->method('getMySQLVersion'); $compatible = $mockVersionInfo->getLatestCompatibleVersion($this->releases); self::assertInstanceOf(Release::class, $compatible); self::assertSame('4.0.10.10', $compatible->version); } /** * Tests getLatestCompatibleVersion() with an new PHP version * * @param list<Release> $versions The versions to use * @param array{int, string} $conditions The conditions that will be executed * @param string|null $matchedLastVersion The version that will be matched */ #[DataProvider('dataProviderVersionConditions')] public function testGetLatestCompatibleVersionWithNewPHPVersion( array $versions, array $conditions, string|null $matchedLastVersion, ): void { Config::getInstance()->settings['Servers'] = []; $mockVersionInfo = $this->createPartialMock(VersionInformation::class, ['getPHPVersion', 'getMySQLVersion']); $mockVersionInfo->expects(self::exactly($conditions[0]))->method('getPHPVersion')->willReturn($conditions[1]); $mockVersionInfo->expects(self::never())->method('getMySQLVersion'); $compatible = $mockVersionInfo->getLatestCompatibleVersion($versions); self::assertSame($matchedLastVersion, $compatible->version ?? null); } /** * Provider for testGetLatestCompatibleVersionWithNewPHPVersion * Returns the conditions to be used for mocks * * @return list<array{list<Release>, array{int, string}, string|null}> */ public static function dataProviderVersionConditions(): array { return [ [ [ new Release('4.9.3', '2019-12-26', '>=5.5,<8.0', '>=5.5'), new Release('5.0.0', '2019-12-26', '>=7.1,<8.0', '>=5.5'), ], [3, '7.0.0'], '4.9.3', ], [ [ new Release('6.0.0', '2019-12-26', '>=5.5,<7.0', '>=5.5'), new Release('5.0.0', '2019-12-26', '>=7.1,<8.0', '>=5.5'), ], [3, '5.6.0'], '6.0.0', ], [ [ new Release('6.0.0-rc1', '2019-12-26', '>=5.5,<7.0', '>=5.5'), new Release('6.0.0-rc2', '2019-12-26', '>=7.1,<8.0', '>=5.5'), ], [3, '5.6.0'], '6.0.0-rc1', ], [ [ new Release('6.0.0', '2019-12-26', '>=5.5,<7.0', '>=5.5'), new Release('5.0.0', '2019-12-26', '>=7.1,<8.0', '>=5.5'), ], [3, '7.0.0'], null, ], [ [ new Release('6.0.0', '2019-12-26', '>=5.5,<7.0', '>=5.5'), new Release('5.0.0', '2019-12-26', '>=7.1,<8.0', '>=5.5'), ], [4, '7.1.0'], '5.0.0', ], [ [ new Release('4.9.3', '2019-12-26', '>=5.5,<8.0', '>=5.5'), new Release('5.0.0', '2019-12-26', '>=7.1,<8.0', '>=5.5'), ], [4, '7.1.0'], '5.0.0', ], [ [ new Release('5.0.0', '2019-12-26', '>=7.1,<8.0', '>=5.5'), new Release('4.9.3', '2019-12-26', '>=5.5,<8.0', '>=5.5'), ], [4, '7.2.0'], '5.0.0', ], ]; } /** * Tests evaluateVersionCondition() method */ public function testEvaluateVersionCondition(): void { $mockVersionInfo = $this->getMockBuilder(VersionInformation::class) ->onlyMethods(['getPHPVersion']) ->getMock(); $mockVersionInfo->expects(self::any()) ->method('getPHPVersion') ->willReturn('5.2.4'); self::assertTrue($mockVersionInfo->evaluateVersionCondition('PHP', '<=5.3')); self::assertTrue($mockVersionInfo->evaluateVersionCondition('PHP', '<5.3')); self::assertTrue($mockVersionInfo->evaluateVersionCondition('PHP', '>=5.2')); self::assertTrue($mockVersionInfo->evaluateVersionCondition('PHP', '>5.2')); self::assertTrue($mockVersionInfo->evaluateVersionCondition('PHP', '!=5.3')); self::assertFalse($mockVersionInfo->evaluateVersionCondition('PHP', '<=5.2')); self::assertFalse($mockVersionInfo->evaluateVersionCondition('PHP', '<5.2')); self::assertFalse($mockVersionInfo->evaluateVersionCondition('PHP', '>=7.0')); self::assertFalse($mockVersionInfo->evaluateVersionCondition('PHP', '>7.0')); self::assertTrue($mockVersionInfo->evaluateVersionCondition('PHP', '!=5.2')); } }
Close