mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-17 22:39:03 +02:00
N°7858 Typo in backup config causing wrong scheduling of first occurrence of weekly backup (if on the same day as first execution)
This commit is contained in:
@@ -201,6 +201,7 @@ abstract class AbstractWeeklyScheduledProcess implements iScheduledProcess
|
||||
static::MODULE_SETTING_TIME,
|
||||
static::GetDefaultModuleSettingTime()
|
||||
);
|
||||
$sProcessTime = trim($sProcessTime);
|
||||
if (!preg_match('/[0-2]\d:[0-5]\d/', $sProcessTime))
|
||||
{
|
||||
throw new ProcessInvalidConfigException($this->GetModuleName().": wrong format for setting '".static::MODULE_SETTING_TIME."' (found '$sProcessTime')");
|
||||
|
||||
@@ -104,6 +104,12 @@ class WeeklyScheduledProcessTest extends ItopTestCase
|
||||
$oWeeklyImpl->InterpretWeekDays();
|
||||
}
|
||||
|
||||
public function testTimeConfigShouldBeTrimmed()
|
||||
{
|
||||
$oWeeklyImpl = new \WeeklyScheduledProcessMockConfig(true, ' 22:33 ', 'monday');
|
||||
$this->assertEquals(new DateTime('2020-05-11 22:33:00'), $oWeeklyImpl->GetNextOccurrence('2020-05-11 21:00'));
|
||||
}
|
||||
|
||||
public function testTimeConfigSecondsShouldBeIgnored()
|
||||
{
|
||||
$oWeeklyImpl = new \WeeklyScheduledProcessMockConfig(true, '22:33:44.123', 'monday');
|
||||
|
||||
Reference in New Issue
Block a user