public function testShouldCommitTheAggregateRootChanges() { // This is kind of a functional test though. $aggregateRoot = EventSourcedAggregateRootStub::create(new AggregateRootIdentifierStub('identifier')); $repository = $this->getMock('RayRutjes\\DomainFoundation\\Repository\\Repository'); $callback = new SimpleSaveAggregateCallback($repository); $callback->save($aggregateRoot); $this->assertTrue($aggregateRoot->uncommittedChanges()->isEmpty()); }
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); }
public function setUp() { $this->identifier = new AggregateRootIdentifierStub('identifier'); $this->aggregateRoot = EventSourcedAggregateRootStub::create($this->identifier); }