Exemplo n.º 1
0
 /**
  * Test Aggregate method.
  */
 public function testAggregate()
 {
     $this->given($post = PostEventSourcedFactory::create($this->faker->sentence, $this->faker->paragraph))->and($event = new PrePersistEvent($post))->then()->object($event->aggregate())->isEqualTo($post);
 }
Exemplo n.º 2
0
 /**
  * @param PrePersistEvent $event
  */
 public function onPrePersist(PrePersistEvent $event)
 {
     $event->aggregate()->version()->setPatch($this->version);
 }