You are here

public function ParserTest::testFloatKeys in Database Sanitize 7

@group legacy @expectedDeprecation Implicit casting of numeric key to string is deprecated since Symfony 3.3 and will throw \Symfony\Component\Yaml\Exception\ParseException in 4.0. Quote your evaluable mapping keys instead on line 2.

File

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

Class

ParserTest

Namespace

Symfony\Component\Yaml\Tests

Code

public function testFloatKeys() {
  $yaml = <<<'EOF'
foo:
    1.2: "bar"
    1.3: "baz"
EOF;
  $expected = array(
    'foo' => array(
      '1.2' => 'bar',
      '1.3' => 'baz',
    ),
  );
  $this
    ->assertEquals($expected, $this->parser
    ->parse($yaml));
}