Skip to content

MessagePackUnpacker() bug #105

@ghost

Description

function testUnpackEmptyArrayMessagePackUnpacker()
    {
        $parser = new \MessagePackUnpacker(false);
        $buffer = "\x80";
        $nread = 0;

        if($parser->execute($buffer, $nread))
        {
            $object = $parser->data();

            $this->assertEquals([], $object);
        }
        else
        {
            $this->fail("Bad Input Message");
        }
    }
array(0) {
}
    function testUnpackEmptyArrayMessagePackUnpackerWithOptions()
    {
        $parser = new \MessagePackUnpacker();
        $parser->setOption(\MessagePack::OPT_PHPONLY, false);
        $buffer = "\x80";
        $nread = 0;

        if($parser->execute($buffer, $nread))
        {
            $object = $parser->data();

            $this->assertEquals([], $object);
        }
        else
        {
            $this->fail("Bad Input Message");
        }
    }
object(stdClass)#273 (0) {
}

Seems like $parser->setOption(\MessagePack::OPT_PHPONLY, false); does nothing!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions