Skip to content

Commit

Permalink
OXDEV-7248 Fix timeformat in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
liulka-oxid committed Nov 21, 2024
1 parent bbcd5f9 commit 5d22818
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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')
]
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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')
]
);

Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand All @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions tests/Codeception/Acceptance/Admin/RemoveUserOrderCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -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')
]
);

Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/Codeception/Acceptance/DownloadableProductCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')
]
);

Expand Down
8 changes: 4 additions & 4 deletions tests/Codeception/Acceptance/ProductStatusTestCest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'
],
[
Expand All @@ -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
Expand All @@ -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'
],
[
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/Integration/Legacy/Price/VoucherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 5d22818

Please sign in to comment.