Skip to content

Commit

Permalink
MAGETWO-57835: [Github] Cannot save customer dob attribute if admin i…
Browse files Browse the repository at this point in the history
…nterface locale is en_GB #6323
  • Loading branch information
slopukhov committed Jul 3, 2017
1 parent 6a53f65 commit b938571
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions app/code/Magento/Ui/Test/Unit/Component/Filters/Type/DateTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,30 @@ public function testPrepare($name, $filterData, $expectedCondition)

if ($expectedCondition !== null) {
$this->processFilters($name, $filterData, $expectedCondition, $uiComponent);
} else {
$uiComponent->method('convertDate')
->willReturnMap([
[$filterData[$name]['from'], new \DateTime($filterData[$name]['from'])],
[$filterData[$name]['to'], new \DateTime($filterData[$name]['to'] . ' 23:59:59')],
]);

$this->filterBuilderMock->expects(static::exactly(2))
->method('setConditionType')
->willReturnSelf();
$this->filterBuilderMock->expects(static::exactly(2))
->method('setField')
->willReturnSelf();
$this->filterBuilderMock->expects(static::exactly(2))
->method('setValue')
->willReturnSelf();

$filterMock = $this->getMock(Filter::class);
$this->filterBuilderMock->expects(static::exactly(2))
->method('create')
->willReturn($filterMock);
$this->dataProviderMock->expects(static::exactly(2))
->method('addFilter')
->with($filterMock);
}

$this->uiComponentFactory->expects($this->any())
Expand Down Expand Up @@ -230,8 +254,8 @@ private function processFilters($name, $filterData, $expectedCondition, $uiCompo
} else {
$uiComponent->method('convertDate')
->willReturnMap([
[$filterData[$name]['from'], 0, 0, 0, new \DateTime($filterData[$name]['from'])],
[$filterData[$name]['to'], 23, 59, 59, new \DateTime($filterData[$name]['to'] . ' 23:59:59')],
[$filterData[$name]['from'], new \DateTime($filterData[$name]['from'])],
[$filterData[$name]['to'], new \DateTime($filterData[$name]['to'] . ' 23:59:59')],
]);
}

Expand Down

0 comments on commit b938571

Please sign in to comment.