OXIESEC PANEL
- Current Dir:
/
/
var
/
www
/
3-31-025chanakya
/
assets
/
payment
/
vendor
/
rmccue
/
requests
/
tests
Server IP: 139.59.38.164
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
03/26/2025 04:24:36 AM
rwxr-xr-x
📁
Auth
-
03/26/2025 04:24:37 AM
rwxr-xr-x
📄
AutoloadTest.php
1.78 KB
03/26/2025 04:23:17 AM
rw-r--r--
📁
Cookie
-
03/26/2025 04:24:37 AM
rwxr-xr-x
📄
CookieTest.php
24.35 KB
03/26/2025 04:23:17 AM
rw-r--r--
📄
EnvironmentTest.php
929 bytes
03/26/2025 04:23:17 AM
rw-r--r--
📁
Exception
-
03/26/2025 04:28:23 AM
rwxr-xr-x
📁
Fixtures
-
03/26/2025 04:24:37 AM
rwxr-xr-x
📄
HooksTest.php
12.29 KB
03/26/2025 04:23:17 AM
rw-r--r--
📄
IdnaEncoderTest.php
9.93 KB
03/26/2025 04:23:17 AM
rw-r--r--
📄
Ipv6Test.php
3.47 KB
03/26/2025 04:23:17 AM
rw-r--r--
📄
IriTest.php
15.86 KB
03/26/2025 04:23:17 AM
rw-r--r--
📄
PortTest.php
2.37 KB
03/26/2025 04:23:17 AM
rw-r--r--
📁
Proxy
-
03/26/2025 04:24:37 AM
rwxr-xr-x
📁
Requests
-
03/26/2025 04:24:37 AM
rwxr-xr-x
📄
RequestsTest.php
12.88 KB
03/26/2025 04:23:17 AM
rw-r--r--
📁
Response
-
03/26/2025 04:24:37 AM
rwxr-xr-x
📄
ResponseTest.php
1.72 KB
03/26/2025 04:23:17 AM
rw-r--r--
📄
SessionTest.php
12.91 KB
03/26/2025 04:23:17 AM
rw-r--r--
📄
SslTest.php
16.13 KB
03/26/2025 04:23:17 AM
rw-r--r--
📄
TestCase.php
1.48 KB
03/26/2025 04:23:17 AM
rw-r--r--
📁
Transport
-
03/26/2025 04:24:37 AM
rwxr-xr-x
📁
Utility
-
03/26/2025 04:24:37 AM
rwxr-xr-x
📄
bootstrap.php
2.84 KB
03/26/2025 04:23:17 AM
rw-r--r--
📁
utils
-
03/26/2025 04:28:23 AM
rwxr-xr-x
Editing: ResponseTest.php
Close
<?php namespace WpOrg\Requests\Tests; use WpOrg\Requests\Exception; use WpOrg\Requests\Response; use WpOrg\Requests\Tests\TestCase; /** * @coversDefaultClass \WpOrg\Requests\Response */ final class ResponseTest extends TestCase { /** * Verify that an exception is thrown when the body content is invalid as JSON. * * @requires extension json * * @covers ::decode_body * * @dataProvider dataInvalidJsonResponse * * @param mixed $body Data to use as the Response body. * * @return void */ public function testInvalidJsonResponse($body) { $this->expectException(Exception::class); $this->expectExceptionMessage('Unable to parse JSON data: '); $response = new Response(); $response->body = $body; $response->decode_body(); } /** * Data provider. * * @return array */ public function dataInvalidJsonResponse() { $data = [ 'text string, not JSON (syntax error)' => ['Invalid JSON'], 'invalid JSON: single quotes (syntax error)' => ["{ 'bar': 'baz' }"], ]; // An empty string is only regarded as invalid JSON since PHP 7.0. if (PHP_VERSION_ID >= 70000) { $data['empty string (syntax error)'] = ['']; } return $data; } /** * Verify correctly decoding a body in valid JSON. * * @requires extension json * * @covers ::decode_body * * @return void */ public function testJsonResponse() { $response = new Response(); $response->body = '{"success": false, "error": [], "data": null}'; $decoded_body = $response->decode_body(); $expected = [ 'success' => false, 'error' => [], 'data' => null, ]; $this->assertSame($expected, $decoded_body); } }