当前位置: 首页>>代码示例>>PHP>>正文


PHP GrumPHP::getTaskConfiguration方法代码示例

本文整理汇总了PHP中GrumPHP\Configuration\GrumPHP::getTaskConfiguration方法的典型用法代码示例。如果您正苦于以下问题:PHP GrumPHP::getTaskConfiguration方法的具体用法?PHP GrumPHP::getTaskConfiguration怎么用?PHP GrumPHP::getTaskConfiguration使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GrumPHP\Configuration\GrumPHP的用法示例。


在下文中一共展示了GrumPHP::getTaskConfiguration方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

 function it_runs_with_additional_modifiers(GrumPHP $grumPHP, GitCommitMsgContext $context)
 {
     $grumPHP->getTaskConfiguration('git_commit_message')->willReturn(['matchers' => ['/.*ümlaut/'], 'additional_modifiers' => 'u']);
     $context->getCommitMessage()->willReturn('message containing ümlaut');
     $result = $this->run($context);
     $result->shouldBeAnInstanceOf(TaskResultInterface::class);
     $result->isPassed()->shouldBe(true);
 }
开发者ID:phpro,项目名称:grumphp,代码行数:8,代码来源:CommitMessageSpec.php

示例2: dirname

 function it_runs_the_suite_but_not_reaching_coverage(GrumPHP $grumPHP, GitCommitMsgContext $context)
 {
     $filename = dirname(dirname(dirname(__DIR__))) . '/test/fixtures/clover_coverage/60-percent-coverage.xml';
     $grumPHP->getTaskConfiguration('clover_coverage')->willReturn(['clover_file' => $filename, 'level' => 100]);
     $result = $this->run($context);
     $result->shouldBeAnInstanceOf(TaskResultInterface::class);
     $result->getResultCode()->shouldBe(TaskResult::FAILED);
     $result->getMessage()->shouldBe('Code coverage is 60%, which is below the accepted 100%' . PHP_EOL);
 }
开发者ID:phpro,项目名称:grumphp,代码行数:9,代码来源:CloverCoverageSpec.php

示例3: ProcessArgumentsCollection

 function it_runs_the_suite_when_composer_has_changed_and_run_always_is_false(GrumPHP $grumPHP, ProcessBuilder $processBuilder, Process $process, ContextInterface $context)
 {
     $grumPHP->getTaskConfiguration('securitychecker')->willReturn(array('run_always' => false));
     $arguments = new ProcessArgumentsCollection();
     $processBuilder->createArgumentsForCommand('security-checker')->willReturn($arguments);
     $processBuilder->buildProcess($arguments)->willReturn($process);
     $process->run()->shouldBeCalled();
     $process->isSuccessful()->willReturn(true);
     $context->getFiles()->willReturn(new FilesCollection(array(new SplFileInfo('composer.lock', '.', 'composer.lock'))));
     $this->run($context);
 }
开发者ID:eltonoliveira,项目名称:grumphp,代码行数:11,代码来源:SecurityCheckerSpec.php

示例4: array

 function it_throws_exception_if_the_process_is_successfull(GrumPHP $grumPHP, ProcessBuilder $processBuilder, Process $process, ContextInterface $context)
 {
     $grumPHP->getTaskConfiguration('git_blacklist')->willReturn(array('keywords' => array('var_dump(')));
     $arguments = new ProcessArgumentsCollection();
     $processBuilder->createArgumentsForCommand('git')->willReturn($arguments);
     $processBuilder->buildProcess($arguments)->willReturn($process);
     $process->run()->shouldBeCalled();
     $process->isSuccessful()->willReturn(true);
     $process->getOutput()->shouldBeCalled();
     $context->getFiles()->willReturn(new FilesCollection(array(new SplFileInfo('file1.php', '.', 'file1.php'))));
     $this->shouldThrow('GrumPHP\\Exception\\RuntimeException')->duringRun($context);
 }
开发者ID:alexlondon07,项目名称:grumphp,代码行数:12,代码来源:BlacklistSpec.php

示例5: ProcessArgumentsCollection

 function it_runs_if_there_are_no_files_but_always_execute_is_passed(GrumPHP $grumPHP, Process $process, ProcessBuilder $processBuilder, ContextInterface $context)
 {
     $grumPHP->getTaskConfiguration('phpunit')->willReturn(['always_execute' => true]);
     $arguments = new ProcessArgumentsCollection();
     $processBuilder->createArgumentsForCommand('phpunit')->willReturn($arguments);
     $processBuilder->buildProcess($arguments)->willReturn($process);
     $process->run()->shouldBeCalled();
     $process->isSuccessful()->willReturn(true);
     $context->getFiles()->willReturn(new FilesCollection());
     $result = $this->run($context);
     $result->shouldBeAnInstanceOf(TaskResultInterface::class);
     $result->isPassed()->shouldBe(true);
 }
开发者ID:phpro,项目名称:grumphp,代码行数:13,代码来源:PhpunitSpec.php

示例6: ProcessArgumentsCollection

 function it_throws_exception_if_the_process_is_successfull(GrumPHP $grumPHP, ProcessBuilder $processBuilder, Process $process, ContextInterface $context)
 {
     $grumPHP->getTaskConfiguration('git_blacklist')->willReturn(['keywords' => ['var_dump(']]);
     $arguments = new ProcessArgumentsCollection();
     $processBuilder->createArgumentsForCommand('git')->willReturn($arguments);
     $processBuilder->buildProcess($arguments)->willReturn($process);
     $process->run()->shouldBeCalled();
     $process->isSuccessful()->willReturn(true);
     $context->getFiles()->willReturn(new FilesCollection([new SplFileInfo('file1.php', '.', 'file1.php')]));
     $result = $this->run($context);
     $result->shouldBeAnInstanceOf(TaskResultInterface::class);
     $result->isPassed()->shouldBe(false);
 }
开发者ID:phpro,项目名称:grumphp,代码行数:13,代码来源:BlacklistSpec.php

示例7: FilesCollection

 function it_runs_the_suite_for_all_files(GrumPHP $grumPHP, ProcessBuilder $processBuilder, Process $process, RunContext $context, PhpCsFixerFormatter $formatter)
 {
     $grumPHP->getTaskConfiguration('phpcsfixer')->willReturn(array('config_file' => '.php_cs'));
     $formatter->resetCounter()->shouldBeCalled();
     $context->getFiles()->willReturn(new FilesCollection(array($file1 = new SplFileInfo('file1.php', '.', 'file1.php'), $file2 = new SplFileInfo('file2.php', '.', 'file2.php'))));
     $processBuilder->createArgumentsForCommand('php-cs-fixer')->willReturn(new ProcessArgumentsCollection());
     $processBuilder->buildProcess(Argument::that(function (ProcessArgumentsCollection $args) use($file1, $file2) {
         return !($args->contains($file1) || $args->contains($file2));
     }))->willReturn($process);
     $process->run()->shouldBeCalled();
     $process->isSuccessful()->willReturn(true);
     $result = $this->run($context);
     $result->shouldBeAnInstanceOf('GrumPHP\\Runner\\TaskResultInterface');
     $result->isPassed()->shouldBe(true);
 }
开发者ID:Big-Shark,项目名称:grumphp,代码行数:15,代码来源:PhpCsFixerSpec.php

示例8: let

 function let(GrumPHP $grumPHP, YamlLinter $linter)
 {
     $grumPHP->getTaskConfiguration('yamllint')->willReturn([]);
     $this->beConstructedWith($grumPHP, $linter);
 }
开发者ID:phpro,项目名称:grumphp,代码行数:5,代码来源:YamlLintSpec.php

示例9: let

 function let(GrumPHP $grumPHP, ProcessBuilder $processBuilder, ProcessFormatterInterface $formatter)
 {
     $grumPHP->getTaskConfiguration('shell')->willReturn(['scripts' => ['script.sh']]);
     $this->beConstructedWith($grumPHP, $processBuilder, $formatter);
 }
开发者ID:phpro,项目名称:grumphp,代码行数:5,代码来源:ShellSpec.php

示例10: array

 function it_runs_with_additional_modifiers(GrumPHP $grumPHP, GitCommitMsgContext $context)
 {
     $grumPHP->getTaskConfiguration('git_commit_message')->willReturn(array('matchers' => array('/.*ümlaut/'), 'additional_modifiers' => 'u'));
     $context->getCommitMessage()->willReturn('message containing ümlaut');
     $this->run($context);
 }
开发者ID:gerdemann,项目名称:grumphp,代码行数:6,代码来源:CommitMessageSpec.php

示例11: let

 function let(GrumPHP $grumPHP, ProcessBuilder $processBuilder, ProcessFormatterInterface $formatter)
 {
     $grumPHP->getTaskConfiguration('phing')->willReturn([]);
     $this->beConstructedWith($grumPHP, $processBuilder, $formatter);
 }
开发者ID:phpro,项目名称:grumphp,代码行数:5,代码来源:PhingSpec.php

示例12: let

 function let(GrumPHP $grumPHP, JsonLinter $linter)
 {
     $grumPHP->getTaskConfiguration('jsonlint')->willReturn(array());
     $this->beConstructedWith($grumPHP, $linter);
 }
开发者ID:Big-Shark,项目名称:grumphp,代码行数:5,代码来源:JsonLintSpec.php

示例13: ProcessArgumentsCollection

 function it_succeeds_when_it_has_no_local_repositories(GrumPHP $grumPHP, ProcessBuilder $processBuilder, Filesystem $filesystem, Process $process, ContextInterface $context)
 {
     $composerFile = 'composer.json';
     $grumPHP->getTaskConfiguration('composer')->willReturn(['file' => $composerFile, 'no_local_repository' => true]);
     $arguments = new ProcessArgumentsCollection();
     $processBuilder->createArgumentsForCommand('composer')->willReturn($arguments);
     $processBuilder->buildProcess($arguments)->willReturn($process);
     $process->run()->shouldBeCalled();
     $process->isSuccessful()->willReturn(true);
     $context->getFiles()->willReturn(new FilesCollection([$composerFile = new SplFileInfo($composerFile, '.', $composerFile)]));
     $filesystem->readFromFileInfo($composerFile)->willReturn('{"repositories": [{"type": "vcs", "url": "/"}]}');
     $result = $this->run($context);
     $result->shouldBeAnInstanceOf(TaskResultInterface::class);
     $result->isPassed()->shouldBe(true);
 }
开发者ID:phpro,项目名称:grumphp,代码行数:15,代码来源:ComposerSpec.php

示例14: let

 function let(GrumPHP $grumPHP, ParserInterface $parser)
 {
     $parser->isInstalled()->willReturn(true);
     $grumPHP->getTaskConfiguration('phpparser')->willReturn([]);
     $this->beConstructedWith($grumPHP, $parser);
 }
开发者ID:phpro,项目名称:grumphp,代码行数:6,代码来源:PhpParserSpec.php

示例15: getConfiguration

 /**
  * {@inheritdoc}
  */
 public function getConfiguration()
 {
     return array_merge($this->getDefaultConfiguration(), $this->grumPHP->getTaskConfiguration($this->getName()));
 }
开发者ID:spinx,项目名称:grumphp,代码行数:7,代码来源:AbstractExternalTask.php


注:本文中的GrumPHP\Configuration\GrumPHP::getTaskConfiguration方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。