Skip to content

Commit 9881bf2

Browse files
author
Dmytro Voskoboinikov
committed
Merge branch 'MAGETWO-44815' into bugfixes
2 parents 232b606 + 1677837 commit 9881bf2

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

app/code/Magento/Reports/Test/Unit/Model/ResourceModel/Order/CollectionTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,9 +251,11 @@ public function testPrepareSummary($useAggregatedData, $mainTable, $isFilter, $g
251251
*/
252252
public function testGetDateRangeFirstPart($range, $customStart, $customEnd, $expectedInterval)
253253
{
254-
$this->markTestIncomplete('MAGETWO-44815');
254+
$timeZoneToReturn = date_default_timezone_get();
255+
date_default_timezone_set('UTC');
255256
$result = $this->collection->getDateRange($range, $customStart, $customEnd);
256257
$interval = $result['to']->diff($result['from']);
258+
date_default_timezone_set($timeZoneToReturn);
257259
$intervalResult = $interval->format('%y %m %d %h:%i:%s');
258260
$this->assertEquals($expectedInterval, $intervalResult);
259261
}

dev/tests/integration/testsuite/Magento/SalesRule/Model/ResourceModel/Rule/CollectionTest.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ public function setValidationFilterDataProvider()
5151
}
5252

5353
/**
54-
* Test checks timezone when timezone is not changed
55-
*
5654
* @magentoDbIsolation enabled
5755
* @magentoAppIsolation enabled
5856
* @magentoDataFixture Magento/SalesRule/_files/rule_specific_date.php
@@ -70,24 +68,20 @@ public function testMultiRulesWithTimezone()
7068
}
7169

7270
/**
73-
* Test checks timezone when timezone is shifted to locale where current day already +1
74-
* (e.g. existed rule: from day 2000-01-01 to day 2000-01-01, after changing timezone 2000-01-02)
75-
*
7671
* @magentoDbIsolation enabled
7772
* @magentoAppIsolation enabled
7873
* @magentoDataFixture Magento/SalesRule/_files/rule_specific_date.php
7974
* @magentoConfigFixture general/locale/timezone Australia/Sydney
8075
*/
8176
public function testMultiRulesWithDifferentTimezone()
8277
{
83-
$this->markTestIncomplete('MAGETWO-44815');
8478
$this->setSpecificTimezone('Australia/Sydney');
8579
$collection = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(
8680
'Magento\SalesRule\Model\ResourceModel\Rule\Collection'
8781
);
8882
$collection->addWebsiteGroupDateFilter(1, 0);
8983
$items = array_values($collection->getItems());
90-
$this->assertEmpty($items);
84+
$this->assertNotEmpty($items);
9185
}
9286

9387
protected function setSpecificTimezone($timezone)

dev/tests/integration/testsuite/Magento/SalesRule/_files/rule_specific_date.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
*/
66

77
/** @var \Magento\SalesRule\Model\Rule $rule */
8+
$tomorrow = new \DateTime();
9+
$tomorrow->add(\DateInterval::createFromDateString('+1 day'));
10+
811
$rule = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\SalesRule\Model\Rule');
912
$rule->setName(
1013
'#1'
@@ -25,5 +28,5 @@
2528
)->setFromDate(
2629
date('Y-m-d')
2730
)->setToDate(
28-
date('Y-m-d')
31+
$tomorrow->format('Y-m-d')
2932
)->save();

0 commit comments

Comments
 (0)