You are here

public function DumperTest::testDumpingArrayObjectInstancesWithNumericKeysRespectsInlineLevel in Lockr 7.3

File

vendor/symfony/yaml/Tests/DumperTest.php, line 386

Class

DumperTest

Namespace

Symfony\Component\Yaml\Tests

Code

public function testDumpingArrayObjectInstancesWithNumericKeysRespectsInlineLevel() {
  $deep = new \ArrayObject([
    'd',
    'e',
  ]);
  $inner = new \ArrayObject([
    'b',
    'c',
    $deep,
  ]);
  $outer = new \ArrayObject([
    'a',
    $inner,
  ]);
  $yaml = $this->dumper
    ->dump($outer, 2, 0, Yaml::DUMP_OBJECT_AS_MAP);
  $expected = <<<YAML
0: a
1:
    0: b
    1: c
    2: { 0: d, 1: e }

YAML;
  $this
    ->assertEquals($expected, $yaml);
}