Skip to content

[Yaml] Failing test for not in-lined map-objects #22392

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

Closed
wants to merge 1 commit into from

Conversation

goetas
Copy link
Contributor

@goetas goetas commented Apr 12, 2017

Q A
Branch? 3.1
Bug fix? no
New feature? no
BC breaks? no
Deprecations? yes/no
Tests pass? no
License MIT

This is a failing test case.

ArrayObject when dumped with Yaml::DUMP_OBJECT_AS_MAP is always inlined.
The $indent option looks to be ignored.

When using array instead of ArrayObject , the result is as expected.

inner3: { deep1: d, deep2: e }

YAML;
$this->assertEquals($expected, $yaml);
Copy link
Contributor Author

@goetas goetas Apr 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current value:

{ outer1: { inner1: b, inner2: c, inner3: { deep1: d, deep2: e } } }

@goetas goetas force-pushed the array-object-as-map-not-inline branch from 58f4278 to 864d54f Compare April 12, 2017 11:04
@goetas goetas changed the title [Yaml] Test case for not in-lined map-objects [Yaml] Failing test for not in-lined map-objects Apr 12, 2017
@goetas goetas force-pushed the array-object-as-map-not-inline branch from 864d54f to c8c50cf Compare April 12, 2017 14:13
@goetas goetas changed the base branch from master to 3.1 April 12, 2017 14:14
@xabbuh
Copy link
Member

xabbuh commented Apr 12, 2017

Thank you @goetas for the failing example test case. I have used it to write a fix for this issue. Can you please try the changes proposed in #22409 and test if they fix your issue?

@xabbuh xabbuh closed this Apr 12, 2017
fabpot added a commit that referenced this pull request May 11, 2017
…goetas, xabbuh)

This PR was merged into the 3.2 branch.

Discussion
----------

[Yaml] respect inline level when dumping objects as maps

| Q             | A
| ------------- | ---
| Branch?       | 3.2
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #22392
| License       | MIT
| Doc PR        |

Commits
-------

3cca48c respect inline level when dumping objects as maps
4f5c149 Test case for not in-lined map-objects
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants