setCommandResolver() public méthode

Sets the used command resolver.
See also: getCommandResolver()
public setCommandResolver ( Webmozart\Console\Api\Resolver\CommandResolver $commandResolver ) : static
$commandResolver Webmozart\Console\Api\Resolver\CommandResolver The command resolver.
Résultat static The current instance.
 public function testResolveCommandDispatchesEvent()
 {
     $args = new StringArgs('');
     $resolver = $this->getMock('Webmozart\\Console\\Api\\Resolver\\CommandResolver');
     $resolvedCommand = $this->getMockBuilder('Webmozart\\Console\\Api\\Resolver\\ResolvedCommand')->disableOriginalConstructor()->getMock();
     $this->config->setCommandResolver($resolver);
     $this->config->addEventListener(ConsoleEvents::PRE_RESOLVE, function (PreResolveEvent $event) use($resolvedCommand) {
         $event->setResolvedCommand($resolvedCommand);
     });
     $application = new ConsoleApplication($this->config);
     $resolver->expects($this->never())->method('resolveCommand');
     $this->assertSame($resolvedCommand, $application->resolveCommand($args));
 }
 public function testSetCommandResolver()
 {
     $resolver = new DefaultResolver();
     $this->config->setCommandResolver($resolver);
     $this->assertSame($resolver, $this->config->getCommandResolver());
 }