/** * @param AggregateRoot $aggregate */ public function save(AggregateRoot $aggregate) { $this->repository->doSave($aggregate); $aggregate->commitChanges(); }
public function testAppendAggregateRootChangesToTheEventStore() { $aggregateRoot = EventSourcedAggregateRootStub::create(new AggregateRootIdentifierStub('identifier')); $this->eventStore->expects($this->once())->method('append')->with($this->identicalTo($this->aggregateRootType), $this->isInstanceOf('RayRutjes\\DomainFoundation\\Domain\\Event\\Stream\\EventStream')); $this->repository->doSave($aggregateRoot); }