/**
  * Test dispatcher method.
  */
 public function testDispatcher()
 {
     $this->given($resolver = new HandlerClassResolver(new FromClassNameResolver(), new HandlerMethodNameDefaultResolver(), new InMemoryLocator([LoginUserCommand::class => new LoginUserCommandHandler()])))->and($middleware = new CommandHandlerMiddleware($resolver))->when($result = $middleware->resolver())->then()->object($result)->isEqualTo($resolver);
 }
예제 #2
0
 /**
  * @param string $commandName
  *
  * @return object
  */
 public function getHandlerFor($commandName)
 {
     $this->ensureCommandHandlerMiddleware();
     return $this->commandHandlerMiddleware->resolver()->getHandlerFor($commandName);
 }