File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed
Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change 11preset : laravel
2-
3- linting : true
Original file line number Diff line number Diff line change 1414 <directory >./tests/</directory >
1515 </testsuite >
1616 </testsuites >
17+ <filter >
18+ <whitelist >
19+ <directory suffix =" .php" >src/</directory >
20+ </whitelist >
21+ </filter >
1722</phpunit >
Original file line number Diff line number Diff line change @@ -306,4 +306,15 @@ public function it_doesnt_pollute_attributes_in_collection_and_sequential_nodes(
306306 ],
307307 ]));
308308 }
309+
310+ /** @test */
311+ public function it_can_convert_array_to_dom ()
312+ {
313+ $ resultDom = (new ArrayToXml ($ this ->testArray ))->toDom ();
314+
315+ $ this ->assertSame ('Luke Skywalker ' , $ resultDom ->getElementsByTagName ('name ' )->item (0 )->nodeValue );
316+ $ this ->assertSame ('Sauron ' , $ resultDom ->getElementsByTagName ('name ' )->item (1 )->nodeValue );
317+ $ this ->assertSame ('Lightsaber ' , $ resultDom ->getElementsByTagName ('weapon ' )->item (0 )->nodeValue );
318+ $ this ->assertSame ('Evil Eye ' , $ resultDom ->getElementsByTagName ('weapon ' )->item (1 )->nodeValue );
319+ }
309320}
You can’t perform that action at this time.
0 commit comments