Exemplo n.º 1
0
    public function testDecoding()
    {
        $input = <<<FORMATTED
{
    "test1": "abcd1",
    "test2": "abcd2"
}
FORMATTED;
        $expected = ['test1' => 'abcd1', 'test2' => 'abcd2'];
        $json = new Json();
        $json->setEncodingOptions(JSON_PRETTY_PRINT);
        $output = $json->decode($input);
        $this->assertSame($expected, $output);
    }