Skip to content

Commit 382df44

Browse files
oshmyheliukshiftedreality
authored andcommitted
MAGECLOUD-4845: Patch applying is failing on installation from git (#9)
1 parent 2c776c0 commit 382df44

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Command/Patch/Manager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ public function applyComposerPatches(InputInterface $input, OutputInterface $out
118118
(string)$patchName,
119119
(string)$packageName,
120120
(string)$constraint,
121-
$deployedFromGit
121+
(bool)$deployedFromGit
122122
);
123123

124124
if (null !== $message) {
@@ -156,7 +156,7 @@ public function applyHotFixes(InputInterface $input, OutputInterface $output)
156156

157157
foreach ($files as $file) {
158158
$output->writeln(
159-
$this->applier->applyFile($file, $deployedFromGit)
159+
$this->applier->applyFile($file, (bool)$deployedFromGit)
160160
);
161161
}
162162
}

src/Test/Unit/Command/Patch/ManagerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ public function testApplyComposerPatchesWithFSException()
141141

142142
$inputMock->method('getOption')
143143
->with(Apply::OPT_GIT_INSTALLATION)
144-
->willReturn(false);
144+
->willReturn('0');
145145

146146
$this->manager->applyComposerPatches($inputMock, $outputMock);
147147
}
@@ -160,16 +160,16 @@ public function testExecuteApplyHotFixes()
160160
$this->applierMock->expects($this->exactly(2))
161161
->method('applyFile')
162162
->willReturnMap([
163-
[__DIR__ . '/_files/' . Manager::HOT_FIXES_DIR . '/patch1.patch', false, 'Patch 1 applied'],
164-
[__DIR__ . '/_files/' . Manager::HOT_FIXES_DIR . '/patch2.patch', false, 'Patch 2 applied']
163+
[__DIR__ . '/_files/' . Manager::HOT_FIXES_DIR . '/patch1.patch', true, 'Patch 1 applied'],
164+
[__DIR__ . '/_files/' . Manager::HOT_FIXES_DIR . '/patch2.patch', true, 'Patch 2 applied']
165165
]);
166166

167167
/** @var InputInterface|MockObject $inputMock */
168168
$inputMock = $this->getMockForAbstractClass(InputInterface::class);
169169
$inputMock->expects($this->once())
170170
->method('getOption')
171171
->with(Apply::OPT_GIT_INSTALLATION)
172-
->willReturn(false);
172+
->willReturn('1');
173173
/** @var OutputInterface|MockObject $outputMock */
174174
$outputMock = $this->getMockForAbstractClass(OutputInterface::class);
175175
$outputMock->expects($this->exactly(3))

0 commit comments

Comments
 (0)