File tree 2 files changed +43
-14
lines changed
2 files changed +43
-14
lines changed Original file line number Diff line number Diff line change @@ -225,7 +225,7 @@ public static function convertSimpleXml($xml)
225
225
$ subRowItem = self ::convertSimpleXmlItem ($ childItem );
226
226
$ children = $ childItem ->children ();
227
227
if (!empty ((array )$ children )) {
228
- $ subRowItem ['value ' ] = self ::convertSimpleXmlItem ($ children );
228
+ $ subRowItem ['value ' ] = self ::convertSimpleXml ($ children );
229
229
}
230
230
if (empty ($ rowItem ['value ' ])) {
231
231
$ rowItem ['value ' ] = [];
Original file line number Diff line number Diff line change @@ -47,7 +47,24 @@ class XmlTest extends \Codeception\Test\Unit
47
47
],
48
48
],
49
49
],
50
- ]
50
+ ],
51
+ 'mlp ' => [
52
+ [
53
+ 'value ' => [
54
+ 'sub1 ' => [
55
+ [
56
+ 'value ' => [
57
+ 'sub2 ' => [
58
+ [
59
+ 'value ' => 'val '
60
+ ]
61
+ ]
62
+ ],
63
+ ],
64
+ ],
65
+ ],
66
+ ],
67
+ ],
51
68
];
52
69
53
70
protected $ resultArray = [
@@ -101,7 +118,24 @@ class XmlTest extends \Codeception\Test\Unit
101
118
],
102
119
],
103
120
]
104
- ]
121
+ ],
122
+ 'mlp ' => [
123
+ [
124
+ 'value ' => [
125
+ 'sub1 ' => [
126
+ [
127
+ 'value ' => [
128
+ 'sub2 ' => [
129
+ [
130
+ 'value ' => 'val '
131
+ ]
132
+ ]
133
+ ],
134
+ ],
135
+ ],
136
+ ],
137
+ ],
138
+ ],
105
139
];
106
140
107
141
protected $ xml = '<?xml version="1.0" encoding="utf-8"?>
@@ -117,20 +151,15 @@ protected function _after()
117
151
{
118
152
}
119
153
120
- // public function testEncodeXml()
121
- // {
122
- //
123
- // $xml = \darkfriend\helpers\Xml::encode($this->encodeArray);
124
- //
125
- // $this->assertEquals($xml, $this->xml);
126
- // }
154
+ public function testEncodeXml ()
155
+ {
156
+ $ xml = \darkfriend \helpers \Xml::encode ($ this ->encodeArray );
157
+
158
+ $ this ->assertEquals ($ xml , $ this ->xml );
159
+ }
127
160
128
161
public function testDecodeXml ()
129
162
{
130
- // var_dump($this->resultArray);
131
- var_dump (\darkfriend \helpers \Xml::decode ($ this ->xml ));
132
- die ();
133
-
134
163
$ this ->assertTrue (
135
164
\darkfriend \helpers \Xml::decode ($ this ->xml ) === $ this ->resultArray
136
165
);
You can’t perform that action at this time.
0 commit comments