/**
  * @param AggregateId $id
  * @return EventStream
  */
 private function createEventStream(AggregateId $id)
 {
     $envelope1 = EventEnvelope::envelop(EventId::fromString('event-1'), 'event_1', \Mockery::mock('SimpleES\\EventSourcing\\Event\\DomainEvent'), $id, 0);
     $envelope2 = EventEnvelope::envelop(EventId::fromString('event-2'), 'event_2', \Mockery::mock('SimpleES\\EventSourcing\\Event\\DomainEvent'), $id, 1);
     $envelope3 = EventEnvelope::envelop(EventId::fromString('event-3'), 'event_3', \Mockery::mock('SimpleES\\EventSourcing\\Event\\DomainEvent'), $id, 2);
     return new EventStream($id, [$envelope1, $envelope2, $envelope3]);
 }
 public function setUp()
 {
     $aggregateId = AggregateId::fromString('some-id');
     $eventId = EventId::fromString('some-id');
     $this->event = \Mockery::mock('SimpleES\\EventSourcing\\Event\\DomainEvent');
     $this->envelope = EventEnvelope::envelop($eventId, 'some_name', $this->event, $aggregateId, 123);
 }
 /**
  * @test
  */
 public function itDoesNotChangeItselfWhenMetadataIsenrich()
 {
     $originalMetadata = $this->envelope->metadata();
     $this->envelope->enrichMetadata(new Metadata(['some-key' => 'Some value']));
     $this->assertSame($originalMetadata, $this->envelope->metadata());
 }