/**
  * @test
  */
 public function it_should_handle_with_response()
 {
     $wholeMessageLength = 0 + \Madkom\EventStore\Client\Domain\Socket\Message\MessageConfiguration::INT_32_LENGTH + \Madkom\EventStore\Client\Domain\Socket\Message\MessageConfiguration::HEADER_LENGTH;
     $buffer = new \TrafficCophp\ByteBuffer\Buffer($wholeMessageLength);
     $buffer->writeInt32LE(18, 0);
     $buffer->writeInt8(\Madkom\EventStore\Client\Domain\Socket\Message\MessageType::PING, \Madkom\EventStore\Client\Domain\Socket\Message\MessageConfiguration::MESSAGE_TYPE_OFFSET);
     $buffer->writeInt8(\Madkom\EventStore\Client\Domain\Socket\Message\MessageConfiguration::FLAGS_NONE, \Madkom\EventStore\Client\Domain\Socket\Message\MessageConfiguration::FLAG_OFFSET);
     $buffer->write(hex2bin('12350000000000000000000000000000'), \Madkom\EventStore\Client\Domain\Socket\Message\MessageConfiguration::CORRELATION_ID_OFFSET);
     $messageTypeChanged = $this->internalProphet->prophesize('Madkom\\EventStore\\Client\\Domain\\Socket\\Message\\MessageType');
     $messageTypeChanged->getType()->willReturn(\Madkom\EventStore\Client\Domain\Socket\Message\MessageType::HEARTBEAT_REQUEST);
     $messageTypeChanged = $messageTypeChanged->reveal();
     $this->socketMessage->getMessageType()->willReturn($messageTypeChanged);
     $this->socketMessage->getCorrelationID()->willReturn('some');
     $this->messageDecomposer->decomposeMessage((string) $buffer)->willReturn($this->socketMessage->reveal());
     $this->messageComposer->compose(\Prophecy\Argument::type('Madkom\\EventStore\\Client\\Domain\\Socket\\Message\\SocketMessage'))->willReturn('someBinary');
     $this->stream->write('someBinary')->shouldBeCalledTimes(1);
     $this->stream->reveal();
     PHPUnit_Framework_Assert::assertInstanceOf('Madkom\\EventStore\\Client\\Domain\\Socket\\Message\\SocketMessage', $this->streamHandler->handle((string) $buffer));
 }