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 itSimplyProxiesGettingEventsToTheNextEventStore()
 {
     $id = AggregateId::fromString('some-id');
     $eventStream = $this->createEventStream($id);
     $this->nextEventStore->shouldReceive('read')->once()->with($id)->andReturn($eventStream);
     $returnedEnvelopeStream = $this->eventStore->read($id);
     $this->assertSame($eventStream, $returnedEnvelopeStream);
 }
 /**
  * @test
  */
 public function itExposesAnAggregateId()
 {
     $id = AggregateId::fromString('some-id');
     $exposedId = $this->envelope->aggregateId();
     $this->assertTrue($id->equals($exposedId));
 }