/**
  * @test
  */
 public function toolIsDisabled()
 {
     $this->preCommitConfig->setEnabled(false);
     $this->composerFilesValidator = $this->getMockBuilder(ComposerFilesValidator::class)->disableOriginalConstructor()->getMock();
     $this->composerFilesValidator->expects($this->never())->method('validate');
     $this->checkComposerFilesPreCommitExecutor = new CheckComposerFilesPreCommitExecutor($this->preCommitConfig, $this->composerFilesValidator);
     $this->checkComposerFilesPreCommitExecutor->run($this->outputInterface, array());
 }
 /**
  * @test
  */
 public function isEnable()
 {
     $this->preCommitConfig->setEnabled(true);
     $this->codeSnifferHandler->shouldReceive('setOutput');
     $this->codeSnifferHandler->shouldReceive('setFiles');
     $this->codeSnifferHandler->shouldReceive('setNeddle');
     $this->codeSnifferHandler->shouldReceive('run');
     $this->checkCodeStyleCodeSnifferPreCommitExecuter->run($this->outputInterface, array(), 'needle');
 }
 /**
  * @test
  */
 public function isEnabledAndThrow()
 {
     $this->setExpectedException(UnitTestsException::class);
     $this->preCommitConfig->setEnabled(true);
     $this->process->shouldReceive('isSuccessful')->andReturn(false);
     $this->enabledMocks();
     $this->phpunitProcessBuilder->shouldReceive('getProcessBuilder')->andReturn($this->processBuilder);
     $this->phpunitProcessBuilder->shouldReceive('executeProcess');
     $this->unitTestPreCommitExecutor->run($this->outputInterface);
 }
 /**
  * @test
  */
 public function isEnabledAndThrow()
 {
     $this->setExpectedException(UnitTestsException::class);
     $this->phpunitRandomizerBuilder->shouldReceive('setOutput');
     $this->phpunitRandomizerBuilder->shouldReceive('run');
     $this->preCommitConfig->setExtraOptions(['enabled' => true, 'random-mode' => false]);
     $this->process->shouldReceive('isSuccessful')->andReturn(false);
     $this->enabledMocks();
     $this->phpunitProcessBuilder->shouldReceive('getProcessBuilder')->andReturn($this->processBuilder);
     $this->phpunitProcessBuilder->shouldReceive('executeProcess');
     $this->unitTestPreCommitExecutor->run($this->outputInterface);
 }
 /**
  * @test
  */
 public function isEnabled()
 {
     $this->preCommitConfig->setExtraOptions(['enabled' => true, 'level' => 'psr0']);
     $this->fixCodeStyleCsFixerPreCommitExecutor->run($this->outputInterface, array(), 'neddle');
 }
 /**
  * @test
  */
 public function isEnabled()
 {
     $this->preCommitConfig->setEnabled(true);
     $this->checkPhpMessDetectionPreCommitExecuter->run($this->outputInterface, array(), 'neddle');
 }
 /**
  * @test
  */
 public function isDisabled()
 {
     $this->hookConfig->setEnabled(false);
     $this->checkJsonSyntaxPreCommitExecutor->run($this->output, [], 'needle');
 }
 /**
  * @test
  */
 public function toolIsEnabled()
 {
     $this->preCommitConfig->setEnabled(true);
     $this->checkPhpSyntaxLintPreCommitExecuter->run($this->outputInterface, array());
 }
 /**
  * @test
  */
 public function isEnabled()
 {
     $this->preCommitConfig->setEnabled(true);
     $this->fixCodeStyleCsFixerPreCommitExecuter->run($this->outputInterface, array(), 'neddle');
 }
 /**
  * @test
  */
 public function isEnabled()
 {
     $this->preCommitConfig->setExtraOptions(['enabled' => true, 'standard' => 'PSR2']);
     $this->checkCodeStyleCodeSnifferPreCommitExecutor->run($this->outputInterface, array(), 'neddle');
 }