PhpGitHooks\Module\Git\Tests\Stub\FilesCommittedStub::createInvalidComposerFiles PHP Method

createInvalidComposerFiles() public static method

public static createInvalidComposerFiles ( ) : array
return array
    public static function createInvalidComposerFiles()
    {
        $files = [StubCreator::faker()->sha1, 'composer.lock'];
        return self::create($files);
    }

Usage Example

 /**
  * @test
  */
 public function itShouldThrowException()
 {
     $this->expectException(ComposerFilesNotFoundException::class);
     $files = FilesCommittedStub::createInvalidComposerFiles();
     $output = new PreCommitOutputWriter(ComposerTool::CHECKING_MESSAGE);
     $this->shouldWriteOutput($output->getMessage());
     $this->shouldHandleQuery(new ComposerFilesExtractorQuery($files), ComposerFilesResponseStub::createInvalidData());
     $this->shouldWriteLnOutput($output->getFailMessage());
     $this->shouldWriteLnOutput(BadJobLogoResponse::paint($this->errorMessage));
     $this->composerToolCommandHandler->handle(new ComposerToolCommand($files, $this->errorMessage));
 }