Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[YAML] Not handling numeric keys in objects #17709

Copy link
Copy link
Closed
@johnknl

Description

@johnknl
Issue body actions
    /**
     * 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.