Since: 1.0
Author: Bernhard Schussek (bschussek@gmail.com)
Exemplo n.º 1
0
 public function testHandleWithCustomManBinary()
 {
     $this->processLauncher->expects($this->once())->method('isSupported')->will($this->returnValue(true));
     $this->executableFinder->expects($this->never())->method('find');
     $this->processLauncher->expects($this->once())->method('launchProcess')->with('my-man -l %path%', array('path' => $this->path), false)->will($this->returnValue(123));
     $this->handler->setManBinary('my-man');
     $status = $this->handler->handle($this->args, $this->io, $this->command);
     $this->assertSame(123, $status);
 }
Exemplo n.º 2
0
 /**
  * Callback for creating the "--man" handler.
  *
  * @param Args    $args    The console arguments.
  * @param IO      $io      The I/O.
  * @param Command $command The handled command.
  *
  * @return HelpManHandler The created handler.
  */
 public function createManHandler(Args $args, IO $io, Command $command)
 {
     $path = $this->getManPage($command->getApplication(), $args);
     $handler = new HelpManHandler($path, $this->executableFinder, $this->processLauncher);
     $handler->setManBinary($this->manBinary);
     return $handler;
 }