spec\GrumPHP\Task\PhpCsFixerV2Spec::it_runs_the_suite_for_changed_files PHP Метод

it_runs_the_suite_for_changed_files() публичный Метод

public it_runs_the_suite_for_changed_files ( ProcessBuilder $processBuilder, AsyncProcessRunner $processRunner, Process $process, GrumPHP\Task\Context\ContextInterface $context, PhpCsFixerFormatter $formatter )
$processBuilder GrumPHP\Process\ProcessBuilder
$processRunner GrumPHP\Process\AsyncProcessRunner
$process Symfony\Component\Process\Process
$context GrumPHP\Task\Context\ContextInterface
$formatter GrumPHP\Formatter\PhpCsFixerFormatter
    function it_runs_the_suite_for_changed_files(ProcessBuilder $processBuilder, AsyncProcessRunner $processRunner, Process $process, ContextInterface $context, PhpCsFixerFormatter $formatter)
    {
        $formatter->resetCounter()->shouldBeCalled();
        $context->getFiles()->willReturn(new FilesCollection([$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);
        $processRunner->run(Argument::type('array'))->shouldBeCalled();
        $process->isSuccessful()->willReturn(true);
        $result = $this->run($context);
        $result->shouldBeAnInstanceOf(TaskResultInterface::class);
        $result->isPassed()->shouldBe(true);
    }