예제 #1
0
 /**
  * @test
  * @expectedException Prooph\ServiceBus\Exception\RuntimeException
  */
 public function it_throws_exception_if_event_has_no_handler_after_it_has_been_set_and_event_was_triggered()
 {
     $this->commandBus->getActionEventEmitter()->attachListener(MessageBus::EVENT_INITIALIZE, function (ActionEvent $e) {
         $e->setParam(QueryBus::EVENT_PARAM_MESSAGE_HANDLER, null);
     });
     $this->commandBus->dispatch("throw it");
 }
예제 #2
0
 /**
  * @test
  * @expectedException \Prooph\ServiceBus\Exception\RuntimeException
  */
 public function it_throws_exception_if_message_was_not_handled()
 {
     $this->commandBus->getActionEventEmitter()->attachListener(MessageBus::EVENT_INITIALIZE, function (ActionEvent $e) {
         $e->setParam(MessageBus::EVENT_PARAM_MESSAGE_HANDLER, new \stdClass());
     });
     $this->commandBus->dispatch('throw it');
 }