!C99Shell v. 2.1 [PHP 8 Update] [02.02.2022]!

Software: Apache/2.4.53 (Unix) OpenSSL/1.1.1o PHP/7.4.29 mod_perl/2.0.12 Perl/v5.34.1. PHP/7.4.29 

uname -a: Linux vps-2738122-x 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 

uid=1(daemon) gid=1(daemon) grupos=1(daemon) 

Safe-mode: OFF (not secure)

/opt/apex_tdfonline/php/lib/rest/tests/lib/   drwxr-xr-x
Free 13.08 GB of 61.93 GB (21.11%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


Viewing file:     rest_hidratadorTest.php (1.76 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace rest\tests\lib;

use 
rest\lib\rest_hidratador;

class 
rest_hidratadorTest extends \PHPUnit_Framework_TestCase
{


    public function 
testPasamanos()
    {
        
$campos = array('a');
        
$datos = array('a' => 10'b' => 2);
        
$obj rest_hidratador::hidratar_fila($campos$datos);

        
$this->assertEquals(1count($obj));
        
$this->assertEquals(10$obj['a']);
    }

    public function 
testAlias()
    {
        
$campos = array('a' => 'b');
        
$datos = array('a' => 10'b' => 2);
        
$obj rest_hidratador::hidratar_fila($campos$datos);

        
$this->assertEquals(1count($obj));
        
$this->assertEquals(10$obj['b']);
    }

    public function 
testObjeto()
    {
        
$campos = array('a' => array('a' => 'id',
                                     
'n' => 'nombre'),
            
'b'
        
);

        
$datos = array('a' => 10'n' => 'xx''b' => 2'z' => 4);
        
$obj rest_hidratador::hidratar_fila($campos$datos);

        
$this->assertEquals(2count($obj));
        
$this->assertEquals(2$obj['b']);
        
$this->assertEquals(10$obj['a']['id']);
        
$this->assertEquals('xx'$obj['a']['nombre']);
    }


    public function 
testMerge()
    {
        
$campos = array('a' => array('a' => 'id',
                                     
'n' => 'nombre'),
            
'b'
        
);
        
$merge = array('id_fila' => 'b',
                       
'grupos'  => array(
                           
'g' => array('z' => 'x')));

        
$datos = array(
            array(
'a' => 10'n' => 'xx''b' => 2'z' => 4),
            array(
'a' => 10'n' => 'xx''b' => 2'z' => 5),
            array(
'a' => 10'n' => 'xx''b' => 2'z' => 6)
        );

        
$obj rest_hidratador::hidratar($campos$datos$merge);

        
$exp = array(
            array(
'a' => array(
                        
'id'     => 10,
                        
'nombre' => 'xx',
                    ),
                
'b' => 2,
                
'g' =>    array(
                        array(
'x' => 4),
                        array(
'x' => 5),
                        array(
'x' => 6),
                    ),
            ),
        );

        
$this->assertEquals($obj$exp);
    }
}
 

:: 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 8 Update] [02.02.2022] maintained byC99Shell Github | Generation time: 0.5462 ]--