File tree Expand file tree Collapse file tree 2 files changed +25
-0
lines changed
app/code/Magento/Customer
Test/Unit/Model/Metadata/Form Expand file tree Collapse file tree 2 files changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,7 @@ public function validateValue($value)
82
82
public function compactValue ($ value )
83
83
{
84
84
if (is_array ($ value )) {
85
+ ksort ($ value );
85
86
$ value = trim (implode ("\n" , $ value ));
86
87
}
87
88
$ value = [$ value ];
Original file line number Diff line number Diff line change @@ -94,4 +94,28 @@ public function validateValueLengthDataProvider()
94
94
]
95
95
);
96
96
}
97
+
98
+ /**
99
+ * @param array $value value to pass to compactValue()
100
+ * @param string $expected expected output
101
+ *
102
+ * @dataProvider compactValueDataProvider
103
+ */
104
+ public function testCompactValue ($ value , $ expected )
105
+ {
106
+ $ this ->assertSame ($ expected , $ this ->getClass ("line " )->compactValue ($ value ));
107
+ }
108
+
109
+ /**
110
+ * @return array
111
+ */
112
+ public function compactValueDataProvider ()
113
+ {
114
+ return [
115
+ [
116
+ ["b " =>"element1 " , "a " =>"element2 " ],
117
+ ["element2 \nelement1 " ],
118
+ ]
119
+ ];
120
+ }
97
121
}
You can’t perform that action at this time.
0 commit comments