Ejemplo n.º 1
0
 /**
  * @param PostWasCreated $event
  */
 protected function applyPostWasCreated(PostWasCreated $event)
 {
     $this->title = $event->title();
     $this->content = $event->content();
 }
Ejemplo n.º 2
0
 /**
  * Test Version method.
  */
 public function testVersion()
 {
     $this->given($postId = PostId::fromNative(md5(rand())))->when($event = new PostWasCreated($postId, $this->faker->sentence, $this->faker->paragraph))->then()->integer($event->version())->isEqualTo(0)->and()->when($event->setVersion(165))->then()->integer($event->version())->isEqualTo(165);
 }