Пример #1
0
 public function testGetHandlerMethodReturnsParentHandlerByDefault()
 {
     $this->parentConfig->setHandlerMethod('method');
     $this->assertSame('method', $this->config->getHandlerMethod());
 }
Пример #2
0
 public function testHandleWithCustomHandlerMethod()
 {
     $args = new Args(new ArgsFormat());
     $io = $this->getMockBuilder('Webmozart\\Console\\Api\\IO\\IO')->disableOriginalConstructor()->getMock();
     $handler = $this->getMock('stdClass', array('handleFoo'));
     $config = new CommandConfig('command');
     $config->setHandler($handler);
     $config->setHandlerMethod('handleFoo');
     $command = new Command($config);
     $handler->expects($this->once())->method('handleFoo')->with($args, $io, $command)->willReturn(123);
     $this->assertSame(123, $command->handle($args, $io));
 }