Skip to content

Commit 5cfcad4

Browse files
authored
Merge pull request #1 from viktym/patches-json-format-unit-tests
- Update unit tests after moving MagentoVersion dependency
2 parents bedd072 + 22e59d4 commit 5cfcad4

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/Test/Unit/Command/Process/ShowStatusTest.php

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
use Magento\CloudPatches\Command\Process\Action\ReviewAppliedAction;
1111
use Magento\CloudPatches\Command\Process\Renderer;
1212
use Magento\CloudPatches\Command\Process\ShowStatus;
13+
use Magento\CloudPatches\Composer\MagentoVersion;
1314
use Magento\CloudPatches\Console\QuestionFactory;
1415
use Magento\CloudPatches\Patch\Aggregator;
1516
use Magento\CloudPatches\Patch\Data\AggregatedPatch;
@@ -88,6 +89,9 @@ protected function setUp(): void
8889
$this->renderer = $this->createMock(Renderer::class);
8990
$this->questionHelper = $this->createMock(QuestionHelper::class);
9091
$this->questionFactory = $this->createMock(QuestionFactory::class);
92+
/** @var MagentoVersion|MockObject $magentoVersion */
93+
$magentoVersion = $this->createMock(MagentoVersion::class);
94+
9195

9296
$this->manager = new ShowStatus(
9397
$this->aggregator,
@@ -97,7 +101,8 @@ protected function setUp(): void
97101
$this->reviewAppliedAction,
98102
$this->renderer,
99103
$this->questionHelper,
100-
$this->questionFactory
104+
$this->questionFactory,
105+
$magentoVersion
101106
);
102107
}
103108

@@ -147,7 +152,7 @@ public function testShowStatus()
147152
->willReturn([$patch1, $patch2, $patch3, $patch4, $patch5]);
148153

149154
// Show warning message about patch deprecation
150-
$outputMock->expects($this->exactly(3))
155+
$outputMock->expects($this->exactly(4))
151156
->method('writeln')
152157
->withConsecutive(
153158
[$this->anything()],

src/Test/Unit/Command/StatusTest.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use Magento\CloudPatches\Command\Apply;
1313
use Magento\CloudPatches\Command\Process\ShowStatus;
1414
use Magento\CloudPatches\Command\Status;
15-
use Magento\CloudPatches\Composer\MagentoVersion;
1615
use PHPUnit\Framework\MockObject\MockObject;
1716
use PHPUnit\Framework\TestCase;
1817
use Psr\Log\LoggerInterface;
@@ -46,13 +45,10 @@ protected function setUp(): void
4645
{
4746
$this->showStatus = $this->createMock(ShowStatus::class);
4847
$this->logger = $this->getMockForAbstractClass(LoggerInterface::class);
49-
/** @var MagentoVersion|MockObject $magentoVersion */
50-
$magentoVersion = $this->createMock(MagentoVersion::class);
5148

5249
$this->command = new Status(
5350
$this->showStatus,
54-
$this->logger,
55-
$magentoVersion
51+
$this->logger
5652
);
5753
}
5854

0 commit comments

Comments
 (0)