Skip to content

Commit

Permalink
Merge pull request #31 from saloonphp/fix/add-assertion-for-weird-pes…
Browse files Browse the repository at this point in the history
…t-behaviour

Fix | Add Assertion For Weird PEST Behaviour
  • Loading branch information
Sammyjo20 authored Aug 3, 2024
2 parents 2ae4e69 + 9fe9bb7 commit 83dbbe6
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2

[*.{xml}]
indent_size = 3
2 changes: 1 addition & 1 deletion .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
php-version: '8.3'
coverage: none

- name: Install composer dependencies
Expand Down
24 changes: 24 additions & 0 deletions tests/Feature/XmlWriterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,30 @@
);
});

test('when writing nested arrays it will create multiple elements', function () {
$xml = XmlWriter::make()
->setXmlStandalone(true)
->write('orders', [
'order' => [
'title' => '123',
'comment' => 'test',
],
]);

$expected = <<<XML
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<orders>
<order>
<title>123</title>
<comment>test</comment>
</order>
</orders>
XML;

expect($xml)->toBe($expected);
});

test('you can use composable elements in the writer', function () {
$writer = new XmlWriter;

Expand Down

0 comments on commit 83dbbe6

Please sign in to comment.