File tree Expand file tree Collapse file tree 2 files changed +16
-13
lines changed
app/code/Magento/Customer
Test/Unit/Model/Metadata/Form Expand file tree Collapse file tree 2 files changed +16
-13
lines changed Original file line number Diff line number Diff line change 12
12
class Date extends AbstractData
13
13
{
14
14
/**
15
- * { @inheritdoc}
15
+ * @inheritdoc
16
16
*/
17
17
public function extractValue (\Magento \Framework \App \RequestInterface $ request )
18
18
{
@@ -21,7 +21,7 @@ public function extractValue(\Magento\Framework\App\RequestInterface $request)
21
21
}
22
22
23
23
/**
24
- * { @inheritdoc}
24
+ * @inheritdoc
25
25
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
26
26
* @SuppressWarnings(PHPMD.NPathComplexity)
27
27
*/
@@ -95,29 +95,23 @@ public function validateValue($value)
95
95
}
96
96
97
97
/**
98
- * { @inheritdoc}
98
+ * @inheritdoc
99
99
*/
100
100
public function compactValue ($ value )
101
101
{
102
- if ($ value !== false ) {
103
- if (empty ($ value )) {
104
- $ value = null ;
105
- }
106
- return $ value ;
107
- }
108
- return false ;
102
+ return $ value ;
109
103
}
110
104
111
105
/**
112
- * { @inheritdoc}
106
+ * @inheritdoc
113
107
*/
114
108
public function restoreValue ($ value )
115
109
{
116
110
return $ this ->compactValue ($ value );
117
111
}
118
112
119
113
/**
120
- * { @inheritdoc}
114
+ * @inheritdoc
121
115
*/
122
116
public function outputValue ($ format = \Magento \Customer \Model \Metadata \ElementFactory::OUTPUT_FORMAT_TEXT )
123
117
{
Original file line number Diff line number Diff line change @@ -12,6 +12,9 @@ class DateTest extends AbstractFormTestCase
12
12
/** @var \Magento\Customer\Model\Metadata\Form\Date */
13
13
protected $ date ;
14
14
15
+ /**
16
+ * @inheritdoc
17
+ */
15
18
protected function setUp ()
16
19
{
17
20
parent ::setUp ();
@@ -46,6 +49,9 @@ protected function setUp()
46
49
);
47
50
}
48
51
52
+ /**
53
+ * Test extractValue
54
+ */
49
55
public function testExtractValue ()
50
56
{
51
57
$ requestMock = $ this ->getMockBuilder (\Magento \Framework \App \RequestInterface::class)
@@ -174,7 +180,7 @@ public function compactAndRestoreValueDataProvider()
174
180
return [
175
181
[1 , 1 ],
176
182
[false , false ],
177
- ['' , null ],
183
+ [null , null ],
178
184
['test ' , 'test ' ],
179
185
[['element1 ' , 'element2 ' ], ['element1 ' , 'element2 ' ]]
180
186
];
@@ -191,6 +197,9 @@ public function testRestoreValue($value, $expected)
191
197
$ this ->assertSame ($ expected , $ this ->date ->restoreValue ($ value ));
192
198
}
193
199
200
+ /**
201
+ * Test outputValue
202
+ */
194
203
public function testOutputValue ()
195
204
{
196
205
$ this ->assertEquals (null , $ this ->date ->outputValue ());
You can’t perform that action at this time.
0 commit comments