Inheritance: implements PhpGitHooks\Module\Tests\Infrastructure\Stub\RandomStubInterface
 /**
  * @test
  */
 public function itShouldWorksFine()
 {
     $phpMdOptions = PhpMdOptionsStub::random();
     $errorMessage = HookQuestions::PRE_COMMIT_ERROR_MESSAGE_DEFAULT;
     $phpFiles = FilesCommittedStub::createOnlyPhpFiles();
     $outputMessage = new PreCommitOutputWriter(PhpMdTool::CHECKING_MESSAGE);
     $this->shouldWriteOutput($outputMessage->getMessage());
     foreach ($phpFiles as $phpFile) {
         $this->shouldProcessPhpMdTool($phpFile, $phpMdOptions->value(), null);
     }
     $this->shouldWriteLnOutput($outputMessage->getSuccessfulMessage());
     $command = new PhpMdToolCommand($phpFiles, $phpMdOptions->value(), $errorMessage);
     $this->phpMdToolCommandHandler->handle($command);
 }
Exemplo n.º 2
0
 /**
  * @return PhpMd
  */
 public static function createEnabled()
 {
     return self::create(new Undefined(false), EnabledStub::create(true), PhpMdOptionsStub::create(null));
 }