From 22ef7c4fe17b8495594ad27460a6ee8e0a113e04 Mon Sep 17 00:00:00 2001 From: Kev Date: Fri, 13 Oct 2017 14:51:06 +0200 Subject: [PATCH] fix(acceptance): update acceptance tests with dst --- features/bootstrap/DowntimeDSTContext.php | 4 ++-- www/class/centreonDowntime.Broker.class.php | 2 +- www/class/centreonExternalCommand.class.php | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/features/bootstrap/DowntimeDSTContext.php b/features/bootstrap/DowntimeDSTContext.php index 8ee9b0e57ec..438841b5da6 100644 --- a/features/bootstrap/DowntimeDSTContext.php +++ b/features/bootstrap/DowntimeDSTContext.php @@ -189,9 +189,9 @@ public function aDowntimeDuringAllDayOnSummerChangingDateIsScheduled() public function aDowntimeOfNextDayOfSummerChangingDate() { $this->downtimeProperties = array( - 'start_day' => '2021/03/28', + 'start_day' => '2021/03/29', 'start_time' => '00:00', - 'end_day' => '2021/03/28', + 'end_day' => '2021/03/29', 'end_time' => '24:00', 'expected_start' => '2021-03-29 00:00', 'expected_end' => '2021-03-30 00:00', diff --git a/www/class/centreonDowntime.Broker.class.php b/www/class/centreonDowntime.Broker.class.php index f049c212914..c21598987e8 100644 --- a/www/class/centreonDowntime.Broker.class.php +++ b/www/class/centreonDowntime.Broker.class.php @@ -296,7 +296,7 @@ private function manageSummerToWinterTimestamp($timestamp, $timezone) { $dstDate = new DateTime('now', $timezone); $dstDate->setTimestamp($timestamp); - $dateTime2 = clone($dstDate); + $dateTime2 = clone $dstDate; $dateTime2->setTimestamp($timestamp - 3600); if ($dateTime2->getTimestamp() == $dstDate->getTimestamp()) { diff --git a/www/class/centreonExternalCommand.class.php b/www/class/centreonExternalCommand.class.php index 357b1e41df5..59207b2dfdb 100644 --- a/www/class/centreonExternalCommand.class.php +++ b/www/class/centreonExternalCommand.class.php @@ -405,7 +405,7 @@ private function getDowntimeTimestampFromDate($date = 'now', $timezone = '', $st $dateTime = new \DateTime($date, new \DateTimeZone($timezone)); // Winter to summer dst - $dateTime2 = clone($dateTime); + $dateTime2 = clone $dateTime; $dateTime2->setTimestamp($dateTime2->getTimestamp()); if ($dateTime2->format("H") != $dateTime->format("H")) { $hour = $dateTime->format('H'); @@ -414,7 +414,7 @@ private function getDowntimeTimestampFromDate($date = 'now', $timezone = '', $st } // Summer to winter dst - $dateTime3 = clone($dateTime); + $dateTime3 = clone $dateTime; $dateTime3 = $dateTime3->setTimestamp($dateTime3->getTimestamp() - 3600); if ($dateTime3->getTimestamp() == $dateTime->getTimestamp()) { if ($start) { @@ -424,7 +424,7 @@ private function getDowntimeTimestampFromDate($date = 'now', $timezone = '', $st } } - $dateTime4 = clone($dateTime); + $dateTime4 = clone $dateTime; $dateTime4 = $dateTime3->setTimestamp($dateTime4->getTimestamp() + 3600); if ($dateTime4->getTimestamp() == $dateTime->getTimestamp()) { if ($start) {