23 private $cronScriptReadinessCheck;
28 $this->read = $this->createMock(\
Magento\Framework\
Filesystem\Directory\Read::class);
29 $filesystem->expects($this->once())->method(
'getDirectoryRead')->willReturn($this->read);
35 $this->read->expects($this->once())
42 $this->assertEquals($expected, $this->cronScriptReadinessCheck->checkSetup());
47 $this->read->expects($this->once())->method(
'readFile')->willReturn(
'');
52 $this->assertEquals($expected, $this->cronScriptReadinessCheck->checkSetup());
63 $this->read->expects($this->once())->method(
'readFile')->willReturn(json_encode($json));
64 $expected = [
'success' =>
false,
'error' =>
'error'];
65 $this->assertEquals($expected, $this->cronScriptReadinessCheck->checkSetup());
75 $this->read->expects($this->once())->method(
'readFile')->willReturn(json_encode($json));
78 'notice' =>
'We recommend you schedule cron to run every 1 minute' 80 $this->assertEquals($expected, $this->cronScriptReadinessCheck->checkSetup());
89 $this->read->expects($this->once())->method(
'readFile')->willReturn(json_encode($json));
92 'notice' =>
'Unable to determine cron time interval. ' .
93 'We recommend you schedule cron to run every 1 minute' 95 $this->assertEquals($expected, $this->cronScriptReadinessCheck->checkSetup());
105 $this->read->expects($this->once())->method(
'readFile')->willReturn(json_encode($json));
106 $expected = [
'success' =>
true];
107 $this->assertEquals($expected, $this->cronScriptReadinessCheck->checkSetup());
112 $this->read->expects($this->once())
115 $expected = [
'success' =>
false,
'error' =>
'Cron job has not been configured yet'];
116 $this->assertEquals($expected, $this->cronScriptReadinessCheck->checkUpdater());
121 $this->read->expects($this->once())->method(
'readFile')->willReturn(
'');
122 $expected = [
'success' =>
false,
'error' =>
'Cron job has not been configured yet'];
123 $this->assertEquals($expected, $this->cronScriptReadinessCheck->checkUpdater());
134 $this->read->expects($this->once())->method(
'readFile')->willReturn(json_encode($json));
135 $expected = [
'success' =>
false,
'error' =>
'error'];
136 $this->assertEquals($expected, $this->cronScriptReadinessCheck->checkUpdater());
148 $this->read->expects($this->once())->method(
'readFile')->willReturn(json_encode($json));
151 'notice' =>
'We recommend you schedule cron to run every 1 minute' 153 $this->assertEquals($expected, $this->cronScriptReadinessCheck->checkUpdater());
164 $this->read->expects($this->once())->method(
'readFile')->willReturn(json_encode($json));
167 'notice' =>
'Unable to determine cron time interval. ' .
168 'We recommend you schedule cron to run every 1 minute' 170 $this->assertEquals($expected, $this->cronScriptReadinessCheck->checkUpdater());
182 $this->read->expects($this->once())->method(
'readFile')->willReturn(json_encode($json));
183 $expected = [
'success' =>
true];
184 $this->assertEquals($expected, $this->cronScriptReadinessCheck->checkUpdater());
testCheckUpdaterBadTime()
const OTHER_CHECKS_WILL_FAIL_MSG
const KEY_CURRENT_TIMESTAMP
testCheckUpdaterUnknownTime()
testCheckUpdaterNoStatusFile()
testCheckSetupNoCronConfigured()
testCheckUpdaterNoCronConfigured()
testCheckUpdaterCronError()
testCheckSetupCronError()
testCheckSetupNoStatusFile()
const KEY_READINESS_CHECKS
const UPDATER_KEY_FILE_PERMISSIONS_VERIFIED
const KEY_DB_WRITE_PERMISSION_VERIFIED
testCheckSetupUnknownTime()