File tree Expand file tree Collapse file tree 3 files changed +10
-9
lines changed Expand file tree Collapse file tree 3 files changed +10
-9
lines changed Original file line number Diff line number Diff line change 38
38
run : composer phpstan
39
39
40
40
- name : Run tests
41
- run : bash tests/test.sh
41
+ run : tests/test.sh
Original file line number Diff line number Diff line change @@ -36,7 +36,7 @@ public static function domNodeToArray($node)
36
36
if (!isset ($ output [$ t ])) {
37
37
$ output [$ t ] = [];
38
38
}
39
- if (empty ($ v )) {
39
+ if (is_array ( $ v ) && empty ($ v )) {
40
40
$ v = '' ;
41
41
}
42
42
$ output [$ t ][] = $ v ;
Original file line number Diff line number Diff line change 36
36
37
37
$ expected = array (
38
38
39
- "@root " => 'tv ' ,
40
-
41
- "@attributes " => array ( "type " => "cartoon " ),
42
-
43
39
"show " => array (
44
40
45
41
array (
@@ -82,7 +78,11 @@ $expected = array(
82
78
)
83
79
)
84
80
85
- )
81
+ ),
82
+
83
+ "@attributes " => array ( "type " => "cartoon " ),
84
+
85
+ "@root " => 'tv ' ,
86
86
);
87
87
88
88
$ result = \Gaarf \XmlToPhp \Convertor::covertToArray ($ xmlstr );
@@ -92,7 +92,8 @@ if ($result == $expected) {
92
92
} else {
93
93
prettyPrint ('Result ' , 'FAILURE :-( ' );
94
94
prettyPrint ('Input ' , $ xmlstr );
95
- prettyPrint ('Expected ' , $ expected );
96
- prettyPrint ('Output ' , $ result );
95
+ prettyPrint ('Expected ' , $ expected );
96
+ prettyPrint ('Output ' , $ result );
97
97
prettyPrint ('Result ' , 'FAILURE :-( ' );
98
+ exit (1 );
98
99
}
You can’t perform that action at this time.
0 commit comments