本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例8: let
function let(GrumPHP $grumPHP, YamlLinter $linter)
{
$grumPHP->getTaskConfiguration('yamllint')->willReturn([]);
$this->beConstructedWith($grumPHP, $linter);
}
示例9: let
function let(GrumPHP $grumPHP, ProcessBuilder $processBuilder, ProcessFormatterInterface $formatter)
{
$grumPHP->getTaskConfiguration('shell')->willReturn(['scripts' => ['script.sh']]);
$this->beConstructedWith($grumPHP, $processBuilder, $formatter);
}
示例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);
}
示例11: let
function let(GrumPHP $grumPHP, ProcessBuilder $processBuilder, ProcessFormatterInterface $formatter)
{
$grumPHP->getTaskConfiguration('phing')->willReturn([]);
$this->beConstructedWith($grumPHP, $processBuilder, $formatter);
}
示例12: let
function let(GrumPHP $grumPHP, JsonLinter $linter)
{
$grumPHP->getTaskConfiguration('jsonlint')->willReturn(array());
$this->beConstructedWith($grumPHP, $linter);
}
示例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);
}
示例14: let
function let(GrumPHP $grumPHP, ParserInterface $parser)
{
$parser->isInstalled()->willReturn(true);
$grumPHP->getTaskConfiguration('phpparser')->willReturn([]);
$this->beConstructedWith($grumPHP, $parser);
}
示例15: getConfiguration
/**
* {@inheritdoc}
*/
public function getConfiguration()
{
return array_merge($this->getDefaultConfiguration(), $this->grumPHP->getTaskConfiguration($this->getName()));
}