Skip to content

Commit 7f98ec6

Browse files
committed
minor #21650 [Yaml] add tests for specific mapping keys (xabbuh)
This PR was merged into the 2.7 branch. Discussion ---------- [Yaml] add tests for specific mapping keys | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | see symfony/symfony#21643 (comment) | License | MIT | Doc PR | Commits ------- b8e0d705f6 [Yaml] add tests for specific mapping keys
2 parents 1509643 + 52ff438 commit 7f98ec6

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Tests/InlineTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,4 +421,15 @@ public function testVeryLongQuotedStrings()
421421

422422
$this->assertEquals($longStringWithQuotes, $arrayFromYaml['longStringWithQuotes']);
423423
}
424+
425+
public function testBooleanMappingKeysAreConvertedToStrings()
426+
{
427+
$this->assertSame(array('false' => 'foo'), Inline::parse('{false: foo}'));
428+
$this->assertSame(array('true' => 'foo'), Inline::parse('{true: foo}'));
429+
}
430+
431+
public function testTheEmptyStringIsAValidMappingKey()
432+
{
433+
$this->assertSame(array('' => 'foo'), Inline::parse('{ "": foo }'));
434+
}
424435
}

0 commit comments

Comments
 (0)