當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。