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 YAML related tests #6478

Merged
merged 2 commits into from
May 30, 2017
Merged

Fix YAML related tests #6478

merged 2 commits into from
May 30, 2017

Conversation

lcobucci
Copy link
Member

Symfony dropped the implicit conversion so we need to do it by ourselves 😉

We had duplicated keys and that's no longer valid on symfony/yaml 3.3.
@lcobucci lcobucci self-assigned this May 30, 2017
@lcobucci lcobucci requested a review from Ocramius May 30, 2017 11:02
@lcobucci lcobucci added this to the 2.6.0 milestone May 30, 2017
@@ -135,7 +135,6 @@ Doctrine\Tests\Models\CMS\CmsUser:
name: address_id
referencedColumnName: id
cascade: [ persist ]
oneToOne:
Copy link
Contributor

Choose a reason for hiding this comment

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

Why is that key removed ?

Copy link
Member Author

Choose a reason for hiding this comment

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

It's duplicated and the parser now complains

Copy link
Contributor

Choose a reason for hiding this comment

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

seems good to go to me then

Copy link
Member Author

Choose a reason for hiding this comment

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

thanks 😉

@@ -52,7 +52,6 @@ Doctrine\Tests\Models\Company\CompanyPerson:
name: address_id
referencedColumnName: id
cascade: [ persist ]
oneToOne:
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as above ?

$flags = 0;

if (defined(Yaml::class . '::PARSE_KEYS_AS_STRINGS')) {
$flags = Yaml::PARSE_KEYS_AS_STRINGS;
Copy link
Member

Choose a reason for hiding this comment

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

return Yaml::parse(file_get_contents($file), Yaml::PARSE_KEYS_AS_STRINGS);

$flags = Yaml::PARSE_KEYS_AS_STRINGS;
}

return Yaml::parse(file_get_contents($file), $flags);
Copy link
Member

Choose a reason for hiding this comment

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

return Yaml::parse(file_get_contents($file), 0);

Since Symfony 3.3 implicit conversion is not enabled by default so we
need to pass that flag manually.

Related to: symfony/symfony#21774
@lcobucci
Copy link
Member Author

@Ocramius fixed, thanks

@Ocramius Ocramius assigned Ocramius and unassigned lcobucci May 30, 2017
@Ocramius
Copy link
Member

Green! 🚢

@Ocramius Ocramius merged commit 205ee72 into doctrine:master May 30, 2017
@lcobucci lcobucci deleted the fix-yaml-tests branch May 30, 2017 12:05
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