Skip to content

Commit 0a15eea

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 #21643 (comment) | License | MIT | Doc PR | Commits ------- b8e0d70 [Yaml] add tests for specific mapping keys
2 parents ffc1cd5 + b8e0d70 commit 0a15eea

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/Symfony/Component/Yaml/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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy