Skip to content

Commit ef401c1

Browse files
committed
Fixed failed DiCompileCommandTest unit test
- Passing null to parameter #3 ($subject) of type array|string is deprecated
1 parent 9b1016b commit ef401c1

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

setup/src/Magento/Setup/Test/Unit/Console/Command/DiCompileCommandTest.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
use Magento\Setup\Module\Di\App\Task\OperationFactory;
2323
use PHPUnit\Framework\MockObject\MockObject;
2424
use PHPUnit\Framework\TestCase;
25-
use Symfony\Component\Console\Formatter\OutputFormatterInterface;
25+
use Symfony\Component\Console\Formatter\OutputFormatter;
2626
use Symfony\Component\Console\Helper\ProgressBar;
2727
use Symfony\Component\Console\Output\OutputInterface;
2828
use Symfony\Component\Console\Tester\CommandTester;
@@ -62,8 +62,8 @@ class DiCompileCommandTest extends TestCase
6262
/** @var OutputInterface|MockObject */
6363
private $outputMock;
6464

65-
/** @var OutputFormatterInterface|MockObject */
66-
private $outputFormatterMock;
65+
/** @var OutputFormatter */
66+
private $outputFormatter;
6767

6868
/** @var Filesystem\Io\File|MockObject */
6969
private $fileMock;
@@ -113,12 +113,10 @@ protected function setUp(): void
113113
[ComponentRegistrar::LIBRARY, ['/path/to/library/one', '/path (1)/to/library/two']],
114114
]);
115115

116-
$this->outputFormatterMock = $this->createMock(
117-
OutputFormatterInterface::class
118-
);
116+
$this->outputFormatter = new OutputFormatter();
119117
$this->outputMock = $this->getMockForAbstractClass(OutputInterface::class);
120118
$this->outputMock->method('getFormatter')
121-
->willReturn($this->outputFormatterMock);
119+
->willReturn($this->outputFormatter);
122120
$this->fileMock = $this->getMockBuilder(Filesystem\Io\File::class)
123121
->disableOriginalConstructor()
124122
->getMock();

0 commit comments

Comments
 (0)