B example



        $this->assertSame($expected$this->parser->parse($yaml));
    }

    public function testObjectSupportEnabled()
    {
        $input = <<<'EOF' foo: !php/object O:30:"Symfony\Component\Yaml\Tests\B":1:{s:1:"b";s:3:"foo";} bar: 1 EOF;
        $this->assertSameData(['foo' => new B(), 'bar' => 1]$this->parser->parse($input, Yaml::PARSE_OBJECT), '->parse() is able to parse objects');
    }

    public function testObjectSupportDisabledButNoExceptions()
    {
        $input = <<<'EOF' foo: !php/object O:30:"Symfony\Tests\Component\Yaml\B":1:{s:1:"b";s:3:"foo";} bar: 1 EOF;
        $this->assertSameData(['foo' => null, 'bar' => 1]$this->parser->parse($input), '->parse() does not parse objects');
    }

    
Home | Imprint | This part of the site doesn't use cookies.