| @@ 629-645 (lines=17) @@ | ||
| 626 | * @see http://yaml.org/spec/1.2/spec.html#id2759572 |
|
| 627 | * @see http://yaml.org/spec/1.1/#id932806 |
|
| 628 | */ |
|
| 629 | public function testMappingDuplicateKeyBlock() |
|
| 630 | { |
|
| 631 | $input = <<<EOD |
|
| 632 | parent: |
|
| 633 | child: first |
|
| 634 | child: duplicate |
|
| 635 | parent: |
|
| 636 | child: duplicate |
|
| 637 | child: duplicate |
|
| 638 | EOD; |
|
| 639 | $expected = array( |
|
| 640 | 'parent' => array( |
|
| 641 | 'child' => 'first', |
|
| 642 | ), |
|
| 643 | ); |
|
| 644 | $this->assertSame($expected, Yaml::parse($input)); |
|
| 645 | } |
|
| 646 | ||
| 647 | public function testMappingDuplicateKeyFlow() |
|
| 648 | { |
|
| @@ 647-659 (lines=13) @@ | ||
| 644 | $this->assertSame($expected, Yaml::parse($input)); |
|
| 645 | } |
|
| 646 | ||
| 647 | public function testMappingDuplicateKeyFlow() |
|
| 648 | { |
|
| 649 | $input = <<<EOD |
|
| 650 | parent: { child: first, child: duplicate } |
|
| 651 | parent: { child: duplicate, child: duplicate } |
|
| 652 | EOD; |
|
| 653 | $expected = array( |
|
| 654 | 'parent' => array( |
|
| 655 | 'child' => 'first', |
|
| 656 | ), |
|
| 657 | ); |
|
| 658 | $this->assertSame($expected, Yaml::parse($input)); |
|
| 659 | } |
|
| 660 | ||
| 661 | public function testEmptyValue() |
|
| 662 | { |
|