public function andMetaData(array $metadata = array())
 {
     if (empty($metadata)) {
         return $this;
     }
     return new GenericCommandMessage($this->payload, $this->metaData->mergeWith($metadata), $this->id, $this->commandName);
 }
示例#2
0
 /**
  * @covers Governor\Framework\Domain\MetaData::mergeWith
  */
 public function testMergedMetaData()
 {
     $metaDataValues = array('first' => 'value');
     $metaData = new MetaData($metaDataValues);
     $metaDataValues['second'] = 'value';
     $metaDataValues['first'] = 'other';
     $newMetaData = $metaData->mergeWith($metaDataValues);
     $this->assertEquals('other', $newMetaData->get('first'));
     $this->assertEquals('value', $newMetaData->get('second'));
 }