Closed
Description
/**
* Check Symfony\Yaml bug
*
* @test
*/
public function canParseNumericMap()
{
$yaml = <<<YAML
map:
1: one
2: two
YAML;
$actual = Yaml::parse($yaml, true, true, true);
$this->assertInternalType('object', $actual);
$this->assertInternalType('object', $actual->map);
$this->assertTrue(property_exists($actual->map, '1'));
$this->assertTrue(property_exists($actual->map, '2'));
$this->assertSame('one', $actual->map->{'1'});
$this->assertSame('two', $actual->map->{'2'});
}
Result:
$ bin/phpunit --filter=RefResolverTest --stop-on-failure
PHPUnit 4.8.22 by Sebastian Bergmann and contributors.
.F
Time: 161 ms, Memory: 8.75Mb
There was 1 failure:
1) KleijnWeb\SwaggerBundle\Tests\Document\RefResolverTest::canParseNumericMap
Failed asserting that false is true.
/home/jkleijn/Projects/php/kleijnweb/swagger-bundle/src/Tests/Document/RefResolverTest.php:58
FAILURES!
Tests: 2, Assertions: 9, Failures: 1.