PhpGitHooks\Module\PhpUnit\Contract\CommandHandler\PhpUnitToolCommandHandler::handle PHP Method

handle() public method

public handle ( Bruli\EventBusBundle\CommandBus\CommandInterface $command )
$command Bruli\EventBusBundle\CommandBus\CommandInterface
    public function handle(CommandInterface $command)
    {
        $this->phpUnitToolExecutor->execute($command->isRandomMode(), $command->getOptions(), $command->getErrorMessage());
    }

Usage Example

 /**
  * @test
  */
 public function itShouldExecuteAndWorksFine()
 {
     $options = '--testsuite default';
     $errorMessage = HookQuestions::PRE_COMMIT_ERROR_MESSAGE_DEFAULT;
     $outputMessage = new PreCommitOutputWriter(PhpUnitToolExecutor::EXECUTING_MESSAGE);
     $this->shouldWriteLnOutput($outputMessage->getMessage());
     $this->shouldProcessPhpUnit($options, true);
     $this->phpUnitToolCommandHandler->handle(new PhpUnitToolCommand(true, $options, $errorMessage));
 }
PhpUnitToolCommandHandler