From b8e0d705f674533ee0e688184a0544ad59fc6e84 Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Fri, 17 Feb 2017 14:04:52 +0100 Subject: [PATCH] =?UTF-8?q?[Yaml]=C2=A0add=20tests=20for=20specific=20mapp?= =?UTF-8?q?ing=20keys?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Symfony/Component/Yaml/Tests/InlineTest.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Symfony/Component/Yaml/Tests/InlineTest.php b/src/Symfony/Component/Yaml/Tests/InlineTest.php index 56966bacd3..ab8bbed74c 100644 --- a/src/Symfony/Component/Yaml/Tests/InlineTest.php +++ b/src/Symfony/Component/Yaml/Tests/InlineTest.php @@ -420,4 +420,15 @@ class InlineTest extends \PHPUnit_Framework_TestCase $this->assertEquals($longStringWithQuotes, $arrayFromYaml['longStringWithQuotes']); } + + public function testBooleanMappingKeysAreConvertedToStrings() + { + $this->assertSame(array('false' => 'foo'), Inline::parse('{false: foo}')); + $this->assertSame(array('true' => 'foo'), Inline::parse('{true: foo}')); + } + + public function testTheEmptyStringIsAValidMappingKey() + { + $this->assertSame(array('' => 'foo'), Inline::parse('{ "": foo }')); + } }