/** * {@inheritdoc} */ public function reconstituteFromHistory(AggregateHistory $aggregateHistory) { $idClass = get_class($aggregateHistory->aggregateId()); $aggregateClass = $this->mapIdClassToAggregateClass($idClass); /** @noinspection PhpUndefinedMethodInspection */ return $aggregateClass::fromHistory($aggregateHistory); }
/** * @test */ public function itExposesAnAggregateId() { $id = BasketId::fromString('some-id'); $exposedId = $this->aggregateHistory->aggregateId(); $this->assertTrue($id->equals($exposedId)); }