Inheritance: implements PhpGitHooks\Module\Tests\Infrastructure\Stub\RandomStubInterface
コード例 #1
0
 /**
  * @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);
 }
コード例 #2
0
ファイル: PhpMdStub.php プロジェクト: bruli/php-git-hooks
 /**
  * @return PhpMd
  */
 public static function createEnabled()
 {
     return self::create(new Undefined(false), EnabledStub::create(true), PhpMdOptionsStub::create(null));
 }