!C99Shell v. 2.5 [PHP 8 Update] [24.05.2025]!

Software: Apache. PHP/8.1.30 

uname -a: Linux server1.tuhinhossain.com 5.15.0-151-generic #161-Ubuntu SMP Tue Jul 22 14:25:40 UTC
2025 x86_64
 

uid=1002(picotech) gid=1003(picotech) groups=1003(picotech),0(root)  

Safe-mode: OFF (not secure)

/home/picotech/domains/sms.picotech.app/public_html/vendor/telnyx/telnyx-php/tests/   drwxr-xr-x
Free 29.35 GB of 117.98 GB (24.88%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Self remove    Logout    


Viewing file:     TestCase.php (6.27 KB)      -rwxr-xr-x
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
<?php

namespace Telnyx;

/**
 * Base class for Telnyx test cases.
 */
class TestCase extends \PHPUnit_Framework_TestCase
{
    
/** @var string original API base URL */
    
protected $origApiBase;

    
/** @var string original API key */
    
protected $origApiKey;

    
/** @var string original client ID */
    
protected $origClientId;

    
/** @var string original API version */
    
protected $origApiVersion;

    
/** @var string original account ID */
    
protected $origAccountId;

    
/** @var object HTTP client mocker */
    
protected $clientMock;

    protected function 
setUp()
    {
        
// Save original values so that we can restore them after running tests
        
$this->origApiBase Telnyx::$apiBase;
        
$this->origApiKey Telnyx::getApiKey();
        
$this->origClientId Telnyx::getClientId();
        
$this->origApiVersion Telnyx::getApiVersion();
        
$this->origAccountId Telnyx::getAccountId();

        
// Set up host and credentials for Telnyx-mock
        
Telnyx::$apiBase MOCK_URL;
        
Telnyx::setApiKey("KEYSUPERSECRET");
        
Telnyx::setClientId("ca_123");
        
Telnyx::setApiVersion(null);
        
Telnyx::setAccountId(null);

        
// Set up the HTTP client mocker
        
$this->clientMock $this->createMock('\Telnyx\HttpClient\ClientInterface');

        
// By default, use the real HTTP client
        
ApiRequestor::setHttpClient(HttpClient\CurlClient::instance());
    }

    protected function 
tearDown()
    {
        
// Restore original values
        
Telnyx::$apiBase $this->origApiBase;
        
Telnyx::setEnableTelemetry(false);
        
Telnyx::setApiKey($this->origApiKey);
        
Telnyx::setClientId($this->origClientId);
        
Telnyx::setApiVersion($this->origApiVersion);
        
Telnyx::setAccountId($this->origAccountId);
    }

    
/**
     * Sets up a request expectation with the provided parameters. The request
     * will actually go through and be emitted.
     *
     * @param string $method HTTP method (e.g. 'post', 'get', etc.)
     * @param string $path relative path
     * @param array|null $params array of parameters. If null, parameters will
     *   not be checked.
     * @param string[]|null $headers array of headers. Does not need to be
     *   exhaustive. If null, headers are not checked.
     * @param bool $hasFile Whether the request parameters contains a file.
     *   Defaults to false.
     * @param string|null $base base URL (e.g. 'https://api.telnyx.com')
     */
    
protected function expectsRequest(
        
$method,
        
$path,
        
$params null,
        
$headers null,
        
$hasFile false,
        
$base null
    
) {
        
$this->prepareRequestMock($method$path$params$headers$hasFile$base)
            ->
will($this->returnCallback(
                function (
$method$absUrl$headers$params$hasFile) {
                    
$curlClient HttpClient\CurlClient::instance();
                    
ApiRequestor::setHttpClient($curlClient);
                    return 
$curlClient->request($method$absUrl$headers$params$hasFile);
                }
            ));
    }

    
/**
     * Sets up a request expectation with the provided parameters. The request
     * will not actually be emitted, instead the provided response parameters
     * will be returned.
     *
     * @param string $method HTTP method (e.g. 'post', 'get', etc.)
     * @param string $path relative path
     * @param array|null $params array of parameters. If null, parameters will
     *   not be checked.
     * @param string[]|null $headers array of headers. Does not need to be
     *   exhaustive. If null, headers are not checked.
     * @param bool $hasFile Whether the request parameters contains a file.
     *   Defaults to false.
     * @param array $response
     * @param integer $rcode
     * @param string|null $base
     *
     * @return array
     */
    
protected function stubRequest(
        
$method,
        
$path,
        
$params null,
        
$headers null,
        
$hasFile false,
        
$response = [],
        
$rcode 200,
        
$base null
    
) {
        
$this->prepareRequestMock($method$path$params$headers$hasFile$base)
            ->
willReturn([json_encode($response), $rcode, []]);
    }

    
/**
     * Prepares the client mocker for an invocation of the `request` method.
     * This helper method is used by both `expectsRequest` and `stubRequest` to
     * prepare the client mocker to expect an invocation of the `request` method
     * with the provided arguments.
     *
     * @param string $method HTTP method (e.g. 'post', 'get', etc.)
     * @param string $path relative path
     * @param array|null $params array of parameters. If null, parameters will
     *   not be checked.
     * @param string[]|null $headers array of headers. Does not need to be
     *   exhaustive. If null, headers are not checked.
     * @param bool $hasFile Whether the request parameters contains a file.
     *   Defaults to false.
     * @param string|null $base base URL (e.g. 'https://api.telnyx.com')
     *
     * @return PHPUnit_Framework_MockObject_Builder_InvocationMocker
     */
    
private function prepareRequestMock(
        
$method,
        
$path,
        
$params null,
        
$headers null,
        
$hasFile false,
        
$base null
    
) {
        
ApiRequestor::setHttpClient($this->clientMock);

        if (
$base === null) {
            
$base Telnyx::$apiBase;
        }
        
$absUrl $base $path;

        return 
$this->clientMock
            
->expects($this->once())
            ->
method('request')
            ->
with(
                
$this->identicalTo(strtolower($method)),
                
$this->identicalTo($absUrl),
                
// for headers, we only check that all of the headers provided in $headers are
                // present in the list of headers of the actual request
                
$headers === null $this->anything() : $this->callback(function ($array) use ($headers) {
                    foreach (
$headers as $header) {
                        if (!
in_array($header$array)) {
                            return 
false;
                        }
                    }
                    return 
true;
                }),
                
$params === null $this->anything() : $this->identicalTo($params),
                
$this->identicalTo($hasFile)
            );
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ ok ]

:: Make Dir ::
 
[ ok ]
:: Make File ::
 
[ ok ]

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

--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0036 ]--