Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix | Add Assertion For Weird PEST Behaviour #31

Merged
merged 2 commits into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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