You are here

public function ParserTest::testPhpConstantTagMappingKeyWithKeysCastToStrings in Lockr 7.3

@group legacy @expectedDeprecation Using the Yaml::PARSE_KEYS_AS_STRINGS flag is deprecated since Symfony 3.4 as it will be removed in 4.0. Quote your keys when they are evaluable instead.

File

vendor/symfony/yaml/Tests/ParserTest.php, line 2011

Class

ParserTest

Namespace

Symfony\Component\Yaml\Tests

Code

public function testPhpConstantTagMappingKeyWithKeysCastToStrings() {
  $yaml = <<<YAML
transitions:
    !php/const 'Symfony\\Component\\Yaml\\Tests\\B::FOO':
        from:
            - !php/const 'Symfony\\Component\\Yaml\\Tests\\B::BAR'
        to: !php/const 'Symfony\\Component\\Yaml\\Tests\\B::BAZ'
YAML;
  $expected = [
    'transitions' => [
      'foo' => [
        'from' => [
          'bar',
        ],
        'to' => 'baz',
      ],
    ],
  ];
  $this
    ->assertSame($expected, $this->parser
    ->parse($yaml, Yaml::PARSE_CONSTANT | Yaml::PARSE_KEYS_AS_STRINGS));
}