Example #1
0
 public function testReconstructUsingExistingData()
 {
     $metadata = Metadata::from(['foo' => 'bar']);
     $uuid = Uuid::uuid4();
     $message = new GenericMessage(new SomePayload(), $metadata, $uuid);
     $this->assertSame($uuid, $message->getId());
     $this->assertSame($metadata, $message->getMetadata());
 }
Example #2
0
 /**
  * @return array
  */
 public function jsonSerialize()
 {
     $data = parent::jsonSerialize();
     $data['timestamp'] = $this->timestamp;
     return $data;
 }