function it_create_a_message_event()
 {
     $raw = '
         {
           "sender":{
             "id":"USER_ID"
           },
           "recipient":{
             "id":"PAGE_ID"
           },
           "timestamp":1458692752478,
           "message":{
             "mid":"mid.1457764197618:41d102a3e1ae206a38",
             "seq":73,
             "text":"hello, world!",
             "quick_reply": {
               "payload": "DEVELOPER_DEFINED_PAYLOAD"
             }
           }
         }    
     ';
     $arr = json_decode($raw, true);
     $expectedEvent = new MessageEvent('USER_ID', 'PAGE_ID', 1458692752478, Message::create($arr['message']));
     $event = $this::createMessageEvent($arr);
     $event->shouldBeLike($expectedEvent);
     $event2 = $this::create($arr);
     $event2->shouldBeLike($expectedEvent);
 }
 /**
  * @param array $payload
  *
  * @return MessageEvent
  */
 public static function createMessageEvent(array $payload)
 {
     $message = Message::create($payload['message']);
     $senderId = $payload['sender']['id'];
     $recipientId = $payload['recipient']['id'];
     $timestamp = $payload['timestamp'];
     return new MessageEvent($senderId, $recipientId, $timestamp, $message);
 }