예제 #1
0
 public function testStripRoutingInformationDoesNothingWhenNoRoutingInformationIsPresent()
 {
     $msg = new Message(array('hello', 'world'));
     $msg->stripRoutingInformation();
     $this->assertSame(array(), $msg->getRoutingInformation());
     $this->assertSame(2, $msg->count());
 }
예제 #2
0
 /**
  * Creates a FetchAction message from the Message.
  *
  * @param \AlphaRPC\Common\Socket\Message $msg
  *
  * @throws InvalidArgumentException
  *
  * @return self
  */
 public static function fromMessage(Message $msg)
 {
     $count = $msg->shift();
     if ($count != $msg->count()) {
         throw new InvalidArgumentException('The action count is not the same as the actual number of actions.');
     }
     return new self($msg->toArray());
 }