From 5d2281838894f4fac788fc484a8343815e33c0ba Mon Sep 17 00:00:00 2001 From: Vasyl Liulka Date: Thu, 21 Nov 2024 16:31:12 +0100 Subject: [PATCH] OXDEV-7248 Fix timeformat in tests --- .../Acceptance/Admin/DownloadableProductCest.php | 4 ++-- .../Acceptance/Admin/NotRegisteredUserOrderCest.php | 6 +++--- .../Acceptance/Admin/ProductListStatusTestCest.php | 9 +++++---- .../Codeception/Acceptance/Admin/RemoveUserOrderCest.php | 6 +++--- tests/Codeception/Acceptance/DownloadableProductCest.php | 4 ++-- tests/Codeception/Acceptance/ProductStatusTestCest.php | 8 ++++---- tests/Integration/Legacy/Price/VoucherTest.php | 4 ++-- 7 files changed, 21 insertions(+), 20 deletions(-) diff --git a/tests/Codeception/Acceptance/Admin/DownloadableProductCest.php b/tests/Codeception/Acceptance/Admin/DownloadableProductCest.php index 1b587aaf0f..79ab23c16f 100644 --- a/tests/Codeception/Acceptance/Admin/DownloadableProductCest.php +++ b/tests/Codeception/Acceptance/Admin/DownloadableProductCest.php @@ -47,8 +47,8 @@ public function _before(AcceptanceTester $I): void 'OXDOWNLOADEXPIRATIONTIME' => 24, 'OXLINKEXPIRATIONTIME' => 240, 'OXRESETCOUNT' => 0, - 'OXVALIDUNTIL' => (new DateTime())->modify('+1 week')->format('Y-m-d 00:00:00'), - 'OXTIMESTAMP' => (new DateTime())->format('Y-m-d 00:00:00') + 'OXVALIDUNTIL' => (new DateTime())->modify('+1 week')->format('Y-m-d H:i:s'), + 'OXTIMESTAMP' => (new DateTime())->format('Y-m-d H:i:s') ] ); diff --git a/tests/Codeception/Acceptance/Admin/NotRegisteredUserOrderCest.php b/tests/Codeception/Acceptance/Admin/NotRegisteredUserOrderCest.php index 4355db50ad..d44780e253 100644 --- a/tests/Codeception/Acceptance/Admin/NotRegisteredUserOrderCest.php +++ b/tests/Codeception/Acceptance/Admin/NotRegisteredUserOrderCest.php @@ -52,7 +52,7 @@ private function insertAnOrderInDatabase(AcceptanceTester $I): void 'OXID' => 'NotRegisteredOrderId', 'OXSHOPID' => 1, 'OXUSERID' => 'NotRegisteredUserId', - 'OXORDERDATE' => (new DateTime())->format('Y-m-d 00:00:00'), + 'OXORDERDATE' => (new DateTime())->format('Y-m-d H:i:s'), 'OXORDERNR' => 2, 'OXBILLEMAIL' => 'example01@oxid-esales.dev', 'OXBILLFNAME' => 'name', @@ -69,7 +69,7 @@ private function insertAnOrderInDatabase(AcceptanceTester $I): void 'OXTRANSSTATUS' => 'OK', 'OXFOLDER' => 'ORDERFOLDER_NEW', 'OXDELTYPE' => 'oxidstandard', - 'OXTIMESTAMP' => (new DateTime())->format('Y-m-d 00:00:00') + 'OXTIMESTAMP' => (new DateTime())->format('Y-m-d H:i:s') ] ); @@ -90,7 +90,7 @@ private function insertAnOrderInDatabase(AcceptanceTester $I): void 'OXVAT' => 19, 'OXSTOCK' => 5, 'OXINSERT' => '2008-02-04', - 'OXTIMESTAMP' => (new DateTime())->format('Y-m-d 00:00:00'), + 'OXTIMESTAMP' => (new DateTime())->format('Y-m-d H:i:s'), 'OXSEARCHKEYS' => 'šÄßüл1002', 'OXISSEARCH' => 1, 'OXORDERSHOPID' => 1 diff --git a/tests/Codeception/Acceptance/Admin/ProductListStatusTestCest.php b/tests/Codeception/Acceptance/Admin/ProductListStatusTestCest.php index d86fa9c25c..50b531d767 100644 --- a/tests/Codeception/Acceptance/Admin/ProductListStatusTestCest.php +++ b/tests/Codeception/Acceptance/Admin/ProductListStatusTestCest.php @@ -23,6 +23,7 @@ public function _before(AcceptanceTester $I): void $I->updateConfigInDatabase('blUseTimeCheck', true, 'bool'); } + #[Group('abc')] public function checkProductsStatuses(AcceptanceTester $I): void { $I->wantToTest('Product statuses by time range'); @@ -36,8 +37,8 @@ public function checkProductsStatuses(AcceptanceTester $I): void 'oxarticles', [ 'OXACTIVE' => false, - 'OXACTIVEFROM' => (new DateTime())->modify('-1 day')->format('Y-m-d 00:00:00'), - 'OXACTIVETO' => (new DateTime())->modify('+1 day')->format('Y-m-d 00:00:00') + 'OXACTIVEFROM' => (new DateTime())->modify('-1 day')->format('Y-m-d H:i:s'), + 'OXACTIVETO' => (new DateTime())->modify('+1 day')->format('Y-m-d H:i:s') ], [ 'OXID' => $this->productID @@ -57,8 +58,8 @@ public function checkProductsStatuses(AcceptanceTester $I): void 'oxarticles', [ 'OXACTIVE' => false, - 'OXACTIVEFROM' => (new DateTime())->modify('+1 day')->format('Y-m-d 00:00:00'), - 'OXACTIVETO' => (new DateTime())->modify('+2 day')->format('Y-m-d 00:00:00') + 'OXACTIVEFROM' => (new DateTime())->modify('+1 day')->format('Y-m-d H:i:s'), + 'OXACTIVETO' => (new DateTime())->modify('+2 day')->format('Y-m-d H:i:s') ], [ 'OXID' => $this->productID diff --git a/tests/Codeception/Acceptance/Admin/RemoveUserOrderCest.php b/tests/Codeception/Acceptance/Admin/RemoveUserOrderCest.php index f077d97442..5d2ddf9663 100644 --- a/tests/Codeception/Acceptance/Admin/RemoveUserOrderCest.php +++ b/tests/Codeception/Acceptance/Admin/RemoveUserOrderCest.php @@ -89,7 +89,7 @@ private function insertAnOrderInDatabase(AcceptanceTester $I): void 'OXID' => $this->orderId, 'OXSHOPID' => 1, 'OXUSERID' => 'someUserID', - 'OXORDERDATE' => (new DateTime())->format('Y-m-d 00:00:00'), + 'OXORDERDATE' => (new DateTime())->format('Y-m-d H:i:s'), 'OXORDERNR' => 2, 'OXBILLEMAIL' => 'example01@oxid-esales.dev', 'OXBILLFNAME' => 'name', @@ -106,7 +106,7 @@ private function insertAnOrderInDatabase(AcceptanceTester $I): void 'OXTRANSSTATUS' => 'OK', 'OXFOLDER' => 'ORDERFOLDER_NEW', 'OXDELTYPE' => 'oxidstandard', - 'OXTIMESTAMP' => (new DateTime())->format('Y-m-d 00:00:00') + 'OXTIMESTAMP' => (new DateTime())->format('Y-m-d H:i:s') ] ); @@ -127,7 +127,7 @@ private function insertAnOrderInDatabase(AcceptanceTester $I): void 'OXVAT' => 19, 'OXSTOCK' => 5, 'OXINSERT' => '2008-02-04', - 'OXTIMESTAMP' => (new DateTime())->format('Y-m-d 00:00:00'), + 'OXTIMESTAMP' => (new DateTime())->format('Y-m-d H:i:s'), 'OXSEARCHKEYS' => 'šÄßüл1002', 'OXISSEARCH' => 1, 'OXORDERSHOPID' => 1 diff --git a/tests/Codeception/Acceptance/DownloadableProductCest.php b/tests/Codeception/Acceptance/DownloadableProductCest.php index 65f507747d..6eed88b3b0 100644 --- a/tests/Codeception/Acceptance/DownloadableProductCest.php +++ b/tests/Codeception/Acceptance/DownloadableProductCest.php @@ -54,8 +54,8 @@ public function downloadableFiles(AcceptanceTester $I): void 'OXDOWNLOADEXPIRATIONTIME' => 24, 'OXLINKEXPIRATIONTIME' => 240, 'OXRESETCOUNT' => 0, - 'OXVALIDUNTIL' => (new DateTime())->modify('+1 week')->format('Y-m-d 00:00:00'), - 'OXTIMESTAMP' => (new DateTime())->format('Y-m-d 00:00:00') + 'OXVALIDUNTIL' => (new DateTime())->modify('+1 week')->format('Y-m-d H:i:s'), + 'OXTIMESTAMP' => (new DateTime())->format('Y-m-d H:i:s') ] ); diff --git a/tests/Codeception/Acceptance/ProductStatusTestCest.php b/tests/Codeception/Acceptance/ProductStatusTestCest.php index f91b54a3b6..ac60f40509 100644 --- a/tests/Codeception/Acceptance/ProductStatusTestCest.php +++ b/tests/Codeception/Acceptance/ProductStatusTestCest.php @@ -43,7 +43,7 @@ public function checkProductsTemporaryActiveStatus(AcceptanceTester $I): void 'oxarticles', [ 'OXACTIVE' => false, - 'OXACTIVEFROM' => (new DateTime())->modify('-1 day')->format('Y-m-d 00:00:00'), + 'OXACTIVEFROM' => (new DateTime())->modify('-1 day')->format('Y-m-d H:i:s'), 'OXACTIVETO' => '0000-00-00 00:00:00' ], [ @@ -63,7 +63,7 @@ public function checkProductsTemporaryActiveStatus(AcceptanceTester $I): void [ 'OXACTIVE' => false, 'OXACTIVEFROM' => '0000-00-00 00:00:00', - 'OXACTIVETO' => (new DateTime())->modify('+1 day')->format('Y-m-d 00:00:00') + 'OXACTIVETO' => (new DateTime())->modify('+1 day')->format('Y-m-d H:i:s') ], [ 'OXID' => $this->productID @@ -87,7 +87,7 @@ public function checkProductsTemporaryNotActiveStatus(AcceptanceTester $I): void 'oxarticles', [ 'OXACTIVE' => false, - 'OXACTIVEFROM' => (new DateTime())->modify('+1 day')->format('Y-m-d 00:00:00'), + 'OXACTIVEFROM' => (new DateTime())->modify('+1 day')->format('Y-m-d H:i:s'), 'OXACTIVETO' => '0000-00-00 00:00:00' ], [ @@ -107,7 +107,7 @@ public function checkProductsTemporaryNotActiveStatus(AcceptanceTester $I): void [ 'OXACTIVE' => false, 'OXACTIVEFROM' => '0000-00-00 00:00:00', - 'OXACTIVETO' => (new DateTime())->modify('-1 day')->format('Y-m-d 00:00:00') + 'OXACTIVETO' => (new DateTime())->modify('-1 day')->format('Y-m-d H:i:s') ], [ 'OXID' => $this->productID diff --git a/tests/Integration/Legacy/Price/VoucherTest.php b/tests/Integration/Legacy/Price/VoucherTest.php index 21253cf1e8..447aeb0de9 100644 --- a/tests/Integration/Legacy/Price/VoucherTest.php +++ b/tests/Integration/Legacy/Price/VoucherTest.php @@ -190,9 +190,9 @@ public function testVoucherCanBeApplyOnlyOnce(): void private function createVoucherSeries(string $seriesId, int $discount, bool $calculateOnce): void { $startDate = (new DateTime())->modify('-1 day') - ->format('Y-m-d 00:00:00'); + ->format('Y-m-d H:i:s'); $endDate = (new DateTime())->modify('+1 day') - ->format('Y-m-d 00:00:00'); + ->format('Y-m-d H:i:s'); $voucherSeries = oxNew(VoucherSerie::class); $voucherSeries->setId($seriesId);