8000 consistently parse omitted keys as the colon · symfony/symfony@1804b2d · GitHub
[go: up one dir, main page]

Skip to content

Commit 1804b2d

Browse files
committed
consistently parse omitted keys as the colon
1 parent 0a3cd97 commit 1804b2d

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/Symfony/Component/Yaml/Tests/InlineTest.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line chan B077 ge
@@ -687,6 +687,20 @@ public function testVeryLongQuotedStrings()
687687
$this->assertEquals($longStringWithQuotes, $arrayFromYaml['longStringWithQuotes']);
688688
}
689689

690+
public function testBooleanMappingKeysAreConvertedToStrings()
691+
{
692+
$this->assertSame(array('false' => 'foo'), Inline::parse('{false: foo}'));
693+
}
694+
695+
public function testTheEmptyStringIsAValidMappingKey()
696+
{
697+
$this->assertSame(array('' => 'foo'), Inline::parse('{ "": foo }'));
698+
}
699+
700+
/**
701+
* @group legacy
702+
* @expectedDeprecation Omitting the key of a mapping is deprecated and will throw a ParseException in 4.0.
703+
*/
690704
public function testOmittedMappingKeyIsParsedAsColon()
691705
{
692706
$this->assertSame(array(':' => 'foo'), Inline::parse('{: foo}'));

0 commit comments

Comments
 (0)
0