You are here

public function ParserTest::getParseExceptionOnDuplicateData in Lockr 7.3

File

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

Class

ParserTest

Namespace

Symfony\Component\Yaml\Tests

Code

public function getParseExceptionOnDuplicateData() {
  $tests = [];
  $yaml = <<<EOD
parent: { child: first, child: duplicate }
EOD;
  $tests[] = [
    $yaml,
    'child',
    1,
  ];
  $yaml = <<<EOD
parent:
  child: first,
  child: duplicate
EOD;
  $tests[] = [
    $yaml,
    'child',
    3,
  ];
  $yaml = <<<EOD
parent: { child: foo }
parent: { child: bar }
EOD;
  $tests[] = [
    $yaml,
    'parent',
    2,
  ];
  $yaml = <<<EOD
parent: { child_mapping: { value: bar},  child_mapping: { value: bar} }
EOD;
  $tests[] = [
    $yaml,
    'child_mapping',
    1,
  ];
  $yaml = <<<EOD
parent:
  child_mapping:
    value: bar
  child_mapping:
    value: bar
EOD;
  $tests[] = [
    $yaml,
    'child_mapping',
    4,
  ];
  $yaml = <<<EOD
parent: { child_sequence: ['key1', 'key2', 'key3'],  child_sequence: ['key1', 'key2', 'key3'] }
EOD;
  $tests[] = [
    $yaml,
    'child_sequence',
    1,
  ];
  $yaml = <<<EOD
parent:
  child_sequence:
    - key1
    - key2
    - key3
  child_sequence:
    - key1
    - key2
    - key3
EOD;
  $tests[] = [
    $yaml,
    'child_sequence',
    6,
  ];
  return $tests;
}