/** * EntityDomainEvent constructor. * * @param IdInterface $aggregateId */ public function __construct(IdInterface $aggregateId) { parent::__construct(); $this->aggregateId = $aggregateId; }
/** * PrePersistEvent constructor. * * @param EventSourcedAggregateRootInterface $aggregate */ public function __construct(EventSourcedAggregateRootInterface $aggregate) { parent::__construct(); $this->aggregate = $aggregate; }
/** * Test OccurredOn method. */ public function testOccurredOn() { $this->given($event = new DomainEvent())->then()->object($event->occurredOn())->isInstanceOf(\DateTime::class); }