MessagePack\Tests\Unit\BufferUnpackerTest::testUnpackInsufficientData PHP Method

testUnpackInsufficientData() public method

public testUnpackInsufficientData ( $data, $expectedLength, $actualLength )
    public function testUnpackInsufficientData($data, $expectedLength, $actualLength)
    {
        try {
            $this->unpacker->reset($data)->unpack();
        } catch (InsufficientDataException $e) {
            $this->assertSame("Not enough data to unpack: expected {$expectedLength}, got {$actualLength}.", $e->getMessage());
            return;
        }
        $this->fail('InsufficientDataException was not thrown.');
    }