File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -251,6 +251,39 @@ public function testDecodeArray()
251251 $ this ->assertEquals ($ expected , $ this ->encoder ->decode ($ source , 'xml ' ));
252252 }
253253
254+ public function testDecodeWithoutItemHash ()
255+ {
256+ $ obj = new ScalarDummy ;
257+ $ obj ->xmlFoo = array (
258+ 'foo-bar ' => array (
259+ '@key ' => "value " ,
260+ 'item ' => array ("@key " => 'key ' , "key-val " => 'val ' )
261+ ),
262+ 'Foo ' => array (
263+ 'Bar ' => "Test " ,
264+ '@Type ' => 'test '
265+ ),
266+ 'föo_bär ' => 'a ' ,
267+ "Bar " => array (1 ,2 ,3 ),
268+ 'a ' => 'b ' ,
269+ );
270+ $ expected = array (
271+ 'foo-bar ' => array (
272+ '@key ' => "value " ,
273+ 'key ' => array ('@key ' => 'key ' , "key-val " => 'val ' )
274+ ),
275+ 'Foo ' => array (
276+ 'Bar ' => "Test " ,
277+ '@Type ' => 'test '
278+ ),
279+ 'föo_bär ' => 'a ' ,
280+ "Bar " => array (1 ,2 ,3 ),
281+ 'a ' => 'b ' ,
282+ );
283+ $ xml = $ this ->encoder ->encode ($ obj , 'xml ' );
284+ $ this ->assertEquals ($ expected , $ this ->encoder ->decode ($ xml , 'xml ' ));
285+ }
286+
254287 public function testPreventsComplexExternalEntities ()
255288 {
256289 $ oldCwd = getcwd ();
You can’t perform that action at this time.
0 commit comments