You are here

public function DumperTest::testInlineLevel in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/yaml/Tests/DumperTest.php \Symfony\Component\Yaml\Tests\DumperTest::testInlineLevel()

File

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

Class

DumperTest

Namespace

Symfony\Component\Yaml\Tests

Code

public function testInlineLevel() {
  $expected = <<<EOF
{ '': bar, foo: '#bar', 'foo''bar': {  }, bar: [1, foo], foobar: { foo: bar, bar: [1, foo], foobar: { foo: bar, bar: [1, foo] } } }
EOF;
  $this
    ->assertEquals($expected, $this->dumper
    ->dump($this->array, -10), '->dump() takes an inline level argument');
  $this
    ->assertEquals($expected, $this->dumper
    ->dump($this->array, 0), '->dump() takes an inline level argument');
  $expected = <<<EOF
'': bar
foo: '#bar'
'foo''bar': {  }
bar: [1, foo]
foobar: { foo: bar, bar: [1, foo], foobar: { foo: bar, bar: [1, foo] } }

EOF;
  $this
    ->assertEquals($expected, $this->dumper
    ->dump($this->array, 1), '->dump() takes an inline level argument');
  $expected = <<<EOF
'': bar
foo: '#bar'
'foo''bar': {  }
bar:
    - 1
    - foo
foobar:
    foo: bar
    bar: [1, foo]
    foobar: { foo: bar, bar: [1, foo] }

EOF;
  $this
    ->assertEquals($expected, $this->dumper
    ->dump($this->array, 2), '->dump() takes an inline level argument');
  $expected = <<<EOF
'': bar
foo: '#bar'
'foo''bar': {  }
bar:
    - 1
    - foo
foobar:
    foo: bar
    bar:
        - 1
        - foo
    foobar:
        foo: bar
        bar: [1, foo]

EOF;
  $this
    ->assertEquals($expected, $this->dumper
    ->dump($this->array, 3), '->dump() takes an inline level argument');
  $expected = <<<EOF
'': bar
foo: '#bar'
'foo''bar': {  }
bar:
    - 1
    - foo
foobar:
    foo: bar
    bar:
        - 1
        - foo
    foobar:
        foo: bar
        bar:
            - 1
            - foo

EOF;
  $this
    ->assertEquals($expected, $this->dumper
    ->dump($this->array, 4), '->dump() takes an inline level argument');
  $this
    ->assertEquals($expected, $this->dumper
    ->dump($this->array, 10), '->dump() takes an inline level argument');
}