Skip to content

Commit a7c8328

Browse files
committed
Update dependencies
1 parent bb38b70 commit a7c8328

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

Diff for: src/Container.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use Php\Pie\Command\InfoCommand;
1515
use Php\Pie\Command\InstallCommand;
1616
use Php\Pie\Command\ShowCommand;
17+
use Php\Pie\ComposerIntegration\MinimalHelperSet;
1718
use Php\Pie\ComposerIntegration\QuieterConsoleIO;
1819
use Php\Pie\DependencyResolver\DependencyResolver;
1920
use Php\Pie\DependencyResolver\ResolveDependencyWithComposer;
@@ -25,6 +26,7 @@
2526
use Php\Pie\Installing\WindowsInstall;
2627
use Psr\Container\ContainerInterface;
2728
use Symfony\Component\Console\Helper\HelperSet;
29+
use Symfony\Component\Console\Helper\QuestionHelper;
2830
use Symfony\Component\Console\Input\ArgvInput;
2931
use Symfony\Component\Console\Input\InputInterface;
3032
use Symfony\Component\Console\Output\ConsoleOutput;
@@ -50,7 +52,11 @@ public static function factory(): ContainerInterface
5052
return new QuieterConsoleIO(
5153
$container->get(InputInterface::class),
5254
$container->get(OutputInterface::class),
53-
new HelperSet(),
55+
new MinimalHelperSet(
56+
[
57+
'question' => new QuestionHelper(),
58+
],
59+
),
5460
);
5561
});
5662

Diff for: test/unit/ComposerIntegration/QuieterConsoleIOTest.php

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
namespace Php\PieUnitTest\ComposerIntegration;
66

77
use Composer\IO\IOInterface;
8+
use Php\Pie\ComposerIntegration\MinimalHelperSet;
89
use Php\Pie\ComposerIntegration\QuieterConsoleIO;
910
use PHPUnit\Framework\Attributes\CoversClass;
1011
use PHPUnit\Framework\Attributes\DataProvider;
1112
use PHPUnit\Framework\TestCase;
12-
use Symfony\Component\Console\Helper\HelperSet;
1313
use Symfony\Component\Console\Input\InputInterface;
1414
use Symfony\Component\Console\Output\Output;
1515
use Symfony\Component\Console\Output\OutputInterface;
@@ -29,7 +29,7 @@ public function testErrorsAreLoggedAndWrittenWhenVerbose(): void
2929
->method('write')
3030
->with('Oh no');
3131

32-
$io = new QuieterConsoleIO($symfonyInput, $symfonyOutput, new HelperSet([]));
32+
$io = new QuieterConsoleIO($symfonyInput, $symfonyOutput, $this->createMock(MinimalHelperSet::class));
3333
$io->writeError('Oh no');
3434

3535
self::assertSame(['Oh no'], $io->errors);
@@ -47,7 +47,7 @@ public function testArrayOfErrorsAreLoggedAndWrittenWhenVerbose(): void
4747
->method('write')
4848
->with(['Oh no', 'Bad things']);
4949

50-
$io = new QuieterConsoleIO($symfonyInput, $symfonyOutput, new HelperSet([]));
50+
$io = new QuieterConsoleIO($symfonyInput, $symfonyOutput, $this->createMock(MinimalHelperSet::class));
5151
$io->writeError(['Oh no', 'Bad things']);
5252

5353
self::assertSame(['Oh no', 'Bad things'], $io->errors);
@@ -64,7 +64,7 @@ public function testErrorsAreLoggedButNotWritten(): void
6464
->expects(self::never())
6565
->method('write');
6666

67-
$io = new QuieterConsoleIO($symfonyInput, $symfonyOutput, new HelperSet([]));
67+
$io = new QuieterConsoleIO($symfonyInput, $symfonyOutput, $this->createMock(MinimalHelperSet::class));
6868
$io->writeError('Oh no');
6969

7070
self::assertSame(['Oh no'], $io->errors);
@@ -105,7 +105,7 @@ protected function doWrite(string $message, bool $newline): void
105105
};
106106
$symfonyOutput->setVerbosity($symfonyVerbosity);
107107

108-
$io = new QuieterConsoleIO($symfonyInput, $symfonyOutput, new HelperSet([]));
108+
$io = new QuieterConsoleIO($symfonyInput, $symfonyOutput, $this->createMock(MinimalHelperSet::class));
109109

110110
$io->write('Quiet', verbosity: IOInterface::QUIET);
111111
$io->write('Normal', verbosity: IOInterface::NORMAL);

Diff for: test/unit/DependencyResolver/UnableToResolveRequirementTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
namespace Php\PieUnitTest\DependencyResolver;
66

77
use Composer\Package\PackageInterface;
8+
use Php\Pie\ComposerIntegration\MinimalHelperSet;
89
use Php\Pie\ComposerIntegration\QuieterConsoleIO;
910
use Php\Pie\DependencyResolver\RequestedPackageAndVersion;
1011
use Php\Pie\DependencyResolver\UnableToResolveRequirement;
1112
use PHPUnit\Framework\Attributes\CoversClass;
1213
use PHPUnit\Framework\TestCase;
13-
use Symfony\Component\Console\Helper\HelperSet;
1414
use Symfony\Component\Console\Input\InputInterface;
1515
use Symfony\Component\Console\Output\OutputInterface;
1616

@@ -42,7 +42,7 @@ public function testFromRequirementWithVersion(): void
4242
$io = new QuieterConsoleIO(
4343
$this->createMock(InputInterface::class),
4444
$this->createMock(OutputInterface::class),
45-
$this->createMock(HelperSet::class),
45+
$this->createMock(MinimalHelperSet::class),
4646
);
4747
$io->writeError('message1');
4848
$io->writeError('message2', true, QuieterConsoleIO::VERY_VERBOSE);
@@ -58,7 +58,7 @@ public function testFromRequirementWithoutVersion(): void
5858
$io = new QuieterConsoleIO(
5959
$this->createMock(InputInterface::class),
6060
$this->createMock(OutputInterface::class),
61-
$this->createMock(HelperSet::class),
61+
$this->createMock(MinimalHelperSet::class),
6262
);
6363
$io->writeError('message1');
6464
$io->writeError('message2', true, QuieterConsoleIO::VERY_VERBOSE);

0 commit comments

Comments
 (0)