!C99Shell v.2.1 [PHP 7 Update] [1.12.2019]!

Software: Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/5.4.16. PHP/5.4.16 

uname -a: Linux roko-bkp 3.10.0-1160.102.1.el7.x86_64 #1 SMP Tue Oct 17 15:42:21 UTC 2023 x86_64 

uid=48(apache) gid=48(apache) groups=48(apache),1003(webmaster) 

Safe-mode: OFF (not secure)

/usr/share/phpMyAdmin/test/libraries/rte/   drwxr-xr-x
Free 8.87 GB of 93.48 GB (9.48%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     PMA_RTN_ParameterParser_test.php (6.43 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php
/* vim: set expandtab sw=4 ts=4 sts=4: */
/**
 * Test for parsing of Routine parameters
 *
 * @package PhpMyAdmin-test
 */

/*
 * Needed for PMA_Util::unQuote() and PMA_SQP_parse()
 */
require_once 'libraries/Util.class.php';
require_once 
'libraries/sqlparser.lib.php';

/*
 * Include to test.
 */
require_once 'libraries/rte/rte_routines.lib.php';

/**
 * Test for parsing of Routine parameters
 *
 * @package PhpMyAdmin-test
 */
class PMA_RTN_ParameterParser_Test extends PHPUnit_Framework_TestCase
{
    
/**
     * Test for PMA_RTN_parseRoutineDefiner
     *
     * @param string $source Source
     * @param array  $target Expected output
     *
     * @return void
     *
     * @dataProvider definer_provider
     */
    
public function test_parseDefiner($source$target)
    {
        
PMA_RTN_setGlobals();
        
$this->assertEquals(
            
$target,
            
PMA_RTN_parseRoutineDefiner(PMA_SQP_parse($source))
        );
    }

    
/**
     * Data provider for test_parseDefiner
     *
     * @return array
     */
    
public function definer_provider()
    {
        return array(
            array(
'CREATE PROCEDURE FOO() SELECT NULL'''),
            array(
                
'CREATE DEFINER=`root`@`localhost` PROCEDURE FOO() SELECT NULL',
                
'root@localhost'
            
),
            array(
                
'CREATE DEFINER=`root\\`@`localhost` PROCEDURE FOO() SELECT NULL',
                
'root\\@localhost'
            
),
        );
    }

    
/**
     * Test for PMA_RTN_parseOneParameter
     *
     * @param string $source Source
     * @param array  $target Expected output
     *
     * @return void
     *
     * @dataProvider param_provider
     */
    
public function test_parseOneParameter($source$target)
    {
        
PMA_RTN_setGlobals();
        
$this->assertEquals($targetPMA_RTN_parseOneParameter($source));
    }

    
/**
     * Data provider for test_parseOneParameter
     *
     * @return array
     */
    
public function param_provider()
    {
        return array(
            array(
'`foo` TEXT', array('''foo''TEXT''''')),
            array(
'`foo` INT(20)', array('''foo''INT''20''')),
            array(
'DECIMAL(5,5)', array('''''DECIMAL''5,5''')),
            array(
                
'IN `fo``fo` INT UNSIGNED',
                array(
'IN''fo`fo''INT''''UNSIGNED')
            ),
            array(
                
'OUT bar VARCHAR(1) CHARSET utf8',
                array(
'OUT''bar''VARCHAR''1''utf8')
            ),
            array(
                
'`"baz\'\'` ENUM(\'a\', \'b\') CHARSET latin1',
                array(
'''"baz\'\'''ENUM''\'a\',\'b\'''latin1')
            ),
            array(
                
'INOUT `foo` DECIMAL(5,2) UNSIGNED ZEROFILL',
                array(
'INOUT''foo''DECIMAL''5,2''UNSIGNED ZEROFILL')
            ),
            array(
                
'`foo``s func` SET(\'test\'\'esc"\',   \'more\\\'esc\')',
                array(
                    
'''foo`s func''SET''\'test\'\'esc"\',\'more\\\'esc\''''
                
)
            )
        );
    }

    
/**
     * Test for PMA_RTN_parseAllParameters
     *
     * @param string $query  Query
     * @param string $type   Type
     * @param array  $target Expected output
     *
     * @return void
     *
     * @depends test_parseOneParameter
     * @dataProvider query_provider
     */
    
public function test_parseAllParameters($query$type$target)
    {
        
PMA_RTN_setGlobals();
        
$this->assertEquals(
            
$target,
            
PMA_RTN_parseAllParameters(PMA_SQP_parse($query), $type)
        );
    }

    
/**
     * Data provider for test_parseAllParameters
     *
     * @return array
     */
    
public function query_provider()
    {
        return array(
            array(
                
'CREATE PROCEDURE `foo`() SET @A=0',
                
'PROCEDURE',
                array(
                    
'num' => 0,
                    
'dir' => array(),
                    
'name' => array(),
                    
'type' => array(),
                    
'length' => array(),
                    
'opts' => array()
                )
            ),
            array(
                
'CREATE DEFINER=`user\\`@`somehost``(` FUNCTION `foo```(`baz` INT) BEGIN SELECT NULL; END',
                
'FUNCTION',
                array(
                    
'num' => 1,
                    
'dir' => array(
                        
=> ''
                    
),
                    
'name' => array(
                        
=> 'baz'
                    
),
                    
'type' => array(
                        
=> 'INT'
                    
),
                    
'length' => array(
                        
=> ''
                    
),
                    
'opts' => array(
                        
=> ''
                    
)
                )
            ),
            array(
                
'CREATE PROCEDURE `foo`(IN `baz\\)` INT(25) zerofill unsigned) BEGIN SELECT NULL; END',
                
'PROCEDURE',
                array(
                    
'num' => 1,
                    
'dir' => array(
                        
=> 'IN'
                    
),
                    
'name' => array(
                        
=> 'baz\\)'
                    
),
                    
'type' => array(
                        
=> 'INT'
                    
),
                    
'length' => array(
                        
=> '25'
                    
),
                    
'opts' => array(
                        
=> 'UNSIGNED ZEROFILL'
                    
)
                )
            ),
            array(
                
'CREATE PROCEDURE `foo`(IN `baz\\` INT(001) zerofill, out bazz varchar(15) charset UTF8) BEGIN SELECT NULL; END',
                
'PROCEDURE',
                array(
                    
'num' => 2,
                    
'dir' => array(
                        
=> 'IN',
                        
=> 'OUT'
                    
),
                    
'name' => array(
                        
=> 'baz\\',
                        
=> 'bazz'
                    
),
                    
'type' => array(
                        
=> 'INT',
                        
=> 'VARCHAR'
                    
),
                    
'length' => array(
                        
=> '1',
                        
=> '15'
                    
),
                    
'opts' => array(
                        
=> 'ZEROFILL',
                        
=> 'utf8'
                    
)
                )
            ),
        );
    }
}
?>

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

:: Go Dir ::
 
:: Go File ::
 

--[ c99shell v.2.1 [PHP 7 Update] [1.12.2019] maintained by KaizenLouie and updated by cermmik | C99Shell Github (MySQL update) | Generation time: 0.0042 ]--