You are here

public function ParserTest::testObjectSupportEnabled in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/symfony/yaml/Symfony/Component/Yaml/Tests/ParserTest.php \Symfony\Component\Yaml\Tests\ParserTest::testObjectSupportEnabled()

File

vendor/symfony/yaml/Tests/ParserTest.php, line 440

Class

ParserTest

Namespace

Symfony\Component\Yaml\Tests

Code

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
    ->assertEquals(array(
    'foo' => new B(),
    'bar' => 1,
  ), $this->parser
    ->parse($input, false, true), '->parse() is able to parse objects');
  $input = <<<'EOF'
foo: !php/object:O:30:"Symfony\Component\Yaml\Tests\B":1:{s:1:"b";s:3:"foo";}
bar: 1
EOF;
  $this
    ->assertEquals(array(
    'foo' => new B(),
    'bar' => 1,
  ), $this->parser
    ->parse($input, false, true), '->parse() is able to parse objects');
}