/** * Test Aggregate method. */ public function testAggregate() { $this->given($post = PostEventSourcedFactory::create($this->faker->sentence, $this->faker->paragraph))->and($event = new PreRemoveEvent($post))->then()->object($event->aggregate())->isEqualTo($post); }
/** * @param PreRemoveEvent $event */ public function onPreRemove(PreRemoveEvent $event) { $event->aggregate()->version()->setPatch($this->version); }