Skip to content

Commit 2cc6d47

Browse files
committed
PHPUnit 10 fixes
1 parent f541f49 commit 2cc6d47

File tree

2 files changed

+27
-15
lines changed

2 files changed

+27
-15
lines changed

app/code/Magento/Cron/Test/Unit/Observer/ProcessCronQueueObserverTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ public function testDispatchRunJob(): void
706706
->with('cron_job_run', ['job_name' => 'cron/test_group/test_job1']);
707707

708708
$dateScheduledAt = date('Y-m-d H:i:s', $this->time - 86400);
709-
$scheduleMethods = [
709+
$addScheduleMethods = [
710710
'getJobCode',
711711
'getScheduledAt',
712712
'setStatus',

app/code/Magento/Deploy/Test/Unit/Model/FilesystemTest.php

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -149,21 +149,23 @@ public function testRegenerateStatic(): void
149149
$this->shell
150150
->expects($this->exactly(4))
151151
->method('execute')
152-
->willReturnCallback(function ($arg1) use ($cacheFlushCmd, $setupDiCompileCmd, $staticContentDeployCmd) {
153-
if ($arg1 == $cacheFlushCmd || $arg1 == $setupDiCompileCmd || $arg1 == $staticContentDeployCmd) {
154-
return null;
152+
->willReturnCallback(function ($arg) use ($cacheFlushCmd, $setupDiCompileCmd, $staticContentDeployCmd) {
153+
if ($arg == $cacheFlushCmd ||
154+
$arg == $setupDiCompileCmd ||
155+
$arg == $staticContentDeployCmd) {
156+
return "Compilation complete";
155157
}
156158
});
157159

158160
$this->output
159161
->method('writeln')
160-
->willReturnCallback(function ($arg1) {
161-
if ($arg1 == 'Starting compilation' ||
162-
$arg1 == 'Compilation complete' ||
163-
$arg1 == 'Starting deployment of static content' ||
164-
$arg1 == 'Deployment of static content complete' ||
165-
empty($arg1)
166-
) {
162+
->willReturnCallback(function ($arg) {
163+
if ($arg == 'Starting compilation' ||
164+
$arg == 'Compilation complete' ||
165+
$arg == 'Starting deployment of static content' ||
166+
$arg == 'Deployment of static content complete' ||
167+
empty($arg)
168+
) {
167169
return null;
168170
}
169171
});
@@ -192,8 +194,13 @@ public function testGenerateStaticForNotAllowedStoreViewLocale(): void
192194
$this->shell
193195
->expects($this->exactly(3))
194196
->method('execute')
195-
->withConsecutive([$cacheFlushCmd], [$setupDiCompileCmd], [$cacheFlushCmd], [$staticContentDeployCmd])
196-
->willReturn("Compilation complete");
197+
->willReturnCallback(function ($arg) use ($cacheFlushCmd, $setupDiCompileCmd, $staticContentDeployCmd) {
198+
if ($arg == $cacheFlushCmd ||
199+
$arg == $setupDiCompileCmd ||
200+
$arg == $staticContentDeployCmd) {
201+
return "Compilation complete";
202+
}
203+
});
197204

198205
$this->initAdminLocaleMock('en_US');
199206

@@ -221,8 +228,13 @@ public function testGenerateStaticForNotAllowedAdminLocale(): void
221228
$this->shell
222229
->expects($this->exactly(3))
223230
->method('execute')
224-
->withConsecutive([$cacheFlushCmd], [$setupDiCompileCmd], [$cacheFlushCmd], [$staticContentDeployCmd])
225-
->willReturn("Compilation complete");
231+
->willReturnCallback(function ($arg) use ($cacheFlushCmd, $setupDiCompileCmd, $staticContentDeployCmd) {
232+
if ($arg == $cacheFlushCmd ||
233+
$arg == $setupDiCompileCmd ||
234+
$arg == $staticContentDeployCmd) {
235+
return "Compilation complete";
236+
}
237+
});
226238

227239
$this->initAdminLocaleMock(';echo');
228240

0 commit comments

Comments
 (0)