Ejemplo n.º 1
0
 /**
  * @param ChangePostTitleCommand $command
  */
 public function changePostTitle(ChangePostTitleCommand $command)
 {
     $this->eventBus->dispatch(new PostTitleWasChanged($command->title()));
 }
Ejemplo n.º 2
0
 /**
  * @param DomainEventInterface $event
  */
 protected function dispatch(DomainEventInterface $event)
 {
     $this->eventBus->dispatch($event);
 }
Ejemplo n.º 3
0
 /**
  * Test create without event dispatcher middleware.
  */
 public function testCreateWithoutEventDispatcherMiddleware()
 {
     $this->given($middleware = new LockingMiddleware())->and($eventBus = new EventBus([$middleware]))->then()->exception(function () use($eventBus) {
         $eventBus->dispatch(new LoginUserEvent('*****@*****.**'));
     })->isInstanceOf(NotFoundException::class);
 }