Skip to content

Commit 6a53f65

Browse files
committed
MAGETWO-57835: [Github] Cannot save customer dob attribute if admin interface locale is en_GB #6323
1 parent a2bec20 commit 6a53f65

File tree

1 file changed

+31
-2
lines changed
  • app/code/Magento/Braintree/Test/Unit/Ui/Component/Report/Filters/Type

1 file changed

+31
-2
lines changed

app/code/Magento/Braintree/Test/Unit/Ui/Component/Report/Filters/Type/DateRangeTest.php

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ public function testPrepare($name, $filterData, $expectedCondition)
118118
$uiComponent->method('convertDate')
119119
->willReturnMap([
120120
[
121-
$filterData[$name]['from'], 0, 0, 0,
121+
$filterData[$name]['from'],
122122
new \DateTime($filterData[$name]['from'], new \DateTimeZone('UTC'))
123123
],
124124
[
125-
$filterData[$name]['to'], 23, 59, 59,
125+
$filterData[$name]['to'],
126126
new \DateTime($filterData[$name]['to'] . ' 23:59:00', new \DateTimeZone('UTC'))
127127
],
128128
]);
@@ -161,6 +161,35 @@ public function testPrepare($name, $filterData, $expectedCondition)
161161
->with($filterMock);
162162
break;
163163
}
164+
} else {
165+
$uiComponent->method('convertDate')
166+
->willReturnMap([
167+
[
168+
$filterData[$name]['from'],
169+
new \DateTime($filterData[$name]['from'], new \DateTimeZone('UTC'))
170+
],
171+
[
172+
$filterData[$name]['to'],
173+
new \DateTime($filterData[$name]['to'] . ' 23:59:00', new \DateTimeZone('UTC'))
174+
],
175+
]);
176+
$this->filterBuilderMock->expects(static::exactly(2))
177+
->method('setConditionType')
178+
->willReturnSelf();
179+
$this->filterBuilderMock->expects(static::exactly(2))
180+
->method('setField')
181+
->willReturnSelf();
182+
$this->filterBuilderMock->expects(static::exactly(2))
183+
->method('setValue')
184+
->willReturnSelf();
185+
186+
$filterMock = $this->getMock(Filter::class);
187+
$this->filterBuilderMock->expects(static::exactly(2))
188+
->method('create')
189+
->willReturn($filterMock);
190+
$this->dataProviderMock->expects(static::exactly(2))
191+
->method('addFilter')
192+
->with($filterMock);
164193
}
165194

166195
$this->uiComponentFactory->expects($this->any())

0 commit comments

Comments
 (0)