function it_throws_exception_if_the_process_fails(ProcessBuilder $processBuilder, Process $process, ContextInterface $context)
{
$arguments = new ProcessArgumentsCollection();
$processBuilder->createArgumentsForCommand('phpcs')->willReturn($arguments);
$processBuilder->createArgumentsForCommand('phpcbf')->willReturn($arguments);
$processBuilder->buildProcess($arguments)->willReturn($process);
$process->run()->shouldBeCalled();
$process->isSuccessful()->willReturn(false);
$context->getFiles()->willReturn(new FilesCollection([new SplFileInfo('file1.php', '.', 'file1.php')]));
$result = $this->run($context);
$result->shouldBeAnInstanceOf(TaskResultInterface::class);
$result->isPassed()->shouldBe(false);
}