Skip to content

Commit 8d1339c

Browse files
author
Oleksii Korshenko
authored
Merge pull request #794 from magento-engcom/develop-prs
Merged Public Pull Requests: - #8183 - #8185
2 parents afdd66f + 19516cb commit 8d1339c

File tree

4 files changed

+34
-10
lines changed

4 files changed

+34
-10
lines changed

app/code/Magento/Eav/Model/Attribute/Data/AbstractData.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ protected function _getFormFilter()
242242
if ($filterCode) {
243243
$filterClass = 'Magento\Framework\Data\Form\Filter\\' . ucfirst($filterCode);
244244
if ($filterCode == 'date') {
245-
$filter = new $filterClass($this->_dateFilterFormat(), $this->_localeResolver->getLocale());
245+
$filter = new $filterClass($this->_dateFilterFormat(), $this->_localeResolver);
246246
} else {
247247
$filter = new $filterClass();
248248
}

app/code/Magento/Eav/Test/Unit/Model/Attribute/Data/AbstractDataTest.php

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,10 @@ public function extractedDataDataProvider()
9595
* @param string $expectedResult
9696
* @param array $params
9797
* @param bool $requestScopeOnly
98+
* @param string|null $filter
9899
* @dataProvider getRequestValueDataProvider
99100
*/
100-
public function testGetRequestValue($requestScope, $value, $params, $requestScopeOnly, $expectedResult)
101+
public function testGetRequestValue($requestScope, $value, $params, $requestScopeOnly, $expectedResult, $filter)
101102
{
102103
$requestMock = $this->getMock(
103104
\Magento\Framework\App\Request\Http::class,
@@ -112,8 +113,17 @@ public function testGetRequestValue($requestScope, $value, $params, $requestScop
112113
]));
113114
$requestMock->expects($this->any())->method('getParams')->will($this->returnValue($params));
114115

115-
$attributeMock = $this->getMock(\Magento\Eav\Model\Attribute::class, [], [], '', false);
116+
$attributeMock = $this->getMock(
117+
\Magento\Eav\Model\Attribute::class,
118+
['getInputFilter', 'getAttributeCode'],
119+
[],
120+
'',
121+
false
122+
);
116123
$attributeMock->expects($this->any())->method('getAttributeCode')->will($this->returnValue('attributeCode'));
124+
if ($filter) {
125+
$attributeMock->expects($this->any())->method('getInputFilter')->will($this->returnValue($filter));
126+
}
117127

118128
$this->model->setAttribute($attributeMock);
119129
$this->model->setRequestScope($requestScope);
@@ -133,41 +143,55 @@ public function getRequestValueDataProvider()
133143
'params' => [],
134144
'requestScopeOnly' => true,
135145
'expectedResult' => 'value',
146+
'filter' => null,
136147
],
137148
[
138149
'requestScope' => 'scope/scope',
139150
'value' => 'value',
140151
'params' => ['scope' => ['scope' => ['attributeCode' => 'data']]],
141152
'requestScopeOnly' => true,
142-
'expectedResult' => 'data'
153+
'expectedResult' => 'data',
154+
'filter' => null,
143155
],
144156
[
145157
'requestScope' => 'scope/scope',
146158
'value' => 'value',
147159
'params' => ['scope' => ['scope' => []]],
148160
'requestScopeOnly' => true,
149-
'expectedResult' => false
161+
'expectedResult' => false,
162+
'filter' => null,
150163
],
151164
[
152165
'requestScope' => 'scope/scope',
153166
'value' => 'value',
154167
'params' => ['scope'],
155168
'requestScopeOnly' => true,
156-
'expectedResult' => false
169+
'expectedResult' => false,
170+
'filter' => null,
157171
],
158172
[
159173
'requestScope' => 'scope',
160174
'value' => 'value',
161175
'params' => ['otherScope' => 1],
162176
'requestScopeOnly' => true,
163-
'expectedResult' => false
177+
'expectedResult' => false,
178+
'filter' => null,
164179
],
165180
[
166181
'requestScope' => 'scope',
167182
'value' => 'value',
168183
'params' => ['otherScope' => 1],
169184
'requestScopeOnly' => false,
170-
'expectedResult' => 'value'
185+
'expectedResult' => 'value',
186+
'filter' => null,
187+
],
188+
[
189+
'requestScope' => 'scope',
190+
'value' => '1970-01-01',
191+
'params' => [],
192+
'requestScopeOnly' => false,
193+
'expectedResult' => '1970-01-01',
194+
'filter' => 'date'
171195
]
172196
];
173197
}

app/code/Magento/Sales/view/frontend/email/creditmemo_new_guest.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
</tr>
3535
<tr class="email-summary">
3636
<td>
37-
<h1>{{trans "Your Credit Memo #%creditmemo_id for Order #%order_id" creditmemo_id=$creditmemo.increment_id order_id=$order.incrh1ent_id}}</h1>
37+
<h1>{{trans "Your Credit Memo #%creditmemo_id for Order #%order_id" creditmemo_id=$creditmemo.increment_id order_id=$order.increment_id}}</h1>
3838
</td>
3939
</tr>
4040
<tr class="email-information">

app/design/frontend/Magento/luma/Magento_Sales/email/creditmemo_new_guest.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
</tr>
3434
<tr class="email-summary">
3535
<td>
36-
<h1>{{trans "Your Credit Memo #%creditmemo_id for Order #%order_id" creditmemo_id=$creditmemo.increment_id order_id=$order.incrh1ent_id}}</h1>
36+
<h1>{{trans "Your Credit Memo #%creditmemo_id for Order #%order_id" creditmemo_id=$creditmemo.increment_id order_id=$order.increment_id}}</h1>
3737
</td>
3838
</tr>
3939
<tr class="email-information">

0 commit comments

Comments
 (0)