public function setUp() { $this->testHelper = new TestHelper($this); $id = BasketId::fromString('some-id'); $this->aggregate = $this->testHelper->mockAggregate($id); $this->identityMap = new IdentityMap(); $this->identityMap->add($this->aggregate); }
/** * @test */ public function itDoesNothingIfTheAggregateHasNoRecordedEvents() { $id = BasketId::fromString('some-basket'); $aggregate = $this->testHelper->mockAggregate($id); $aggregate->expects($this->once())->method('hasRecordedEvents')->will($this->returnValue(false)); $this->eventWrapper->expects($this->never())->method('wrap'); $this->eventStore->expects($this->never())->method('commit'); $this->repository->add($aggregate); }