Skip to content

Commit 83dbbe6

Browse files
authored
Merge pull request #31 from saloonphp/fix/add-assertion-for-weird-pest-behaviour
Fix | Add Assertion For Weird PEST Behaviour
2 parents 2ae4e69 + 9fe9bb7 commit 83dbbe6

File tree

3 files changed

+28
-1
lines changed

3 files changed

+28
-1
lines changed

.editorconfig

+3
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ trim_trailing_whitespace = false
1313

1414
[*.{yml,yaml}]
1515
indent_size = 2
16+
17+
[*.{xml}]
18+
indent_size = 3

.github/workflows/phpstan.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
- name: Setup PHP
1919
uses: shivammathur/setup-php@v2
2020
with:
21-
php-version: '8.1'
21+
php-version: '8.3'
2222
coverage: none
2323

2424
- name: Install composer dependencies

tests/Feature/XmlWriterTest.php

+24
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,30 @@
205205
);
206206
});
207207

208+
test('when writing nested arrays it will create multiple elements', function () {
209+
$xml = XmlWriter::make()
210+
->setXmlStandalone(true)
211+
->write('orders', [
212+
'order' => [
213+
'title' => '123',
214+
'comment' => 'test',
215+
],
216+
]);
217+
218+
$expected = <<<XML
219+
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
220+
<orders>
221+
<order>
222+
<title>123</title>
223+
<comment>test</comment>
224+
</order>
225+
</orders>
226+
227+
XML;
228+
229+
expect($xml)->toBe($expected);
230+
});
231+
208232
test('you can use composable elements in the writer', function () {
209233
$writer = new XmlWriter;
210234

0 commit comments

Comments
 (0)