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

Add FormBuilderIteratorTest and provide php-ini setting for precision #3714

Merged
merged 3 commits into from Apr 13, 2016

Conversation

mikemeier
Copy link
Contributor

New PR for #2562

@@ -45,6 +45,8 @@
"jms/di-extra-bundle": "~1.7",
"sensio/generator-bundle": "~2.3|~3.0",
"symfony/yaml": "~2.3|~3.0",
"symfony/security-acl": "~2.4|~3.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why require this is require-dev ? It already is required above.

@greg0ire
Copy link
Contributor

Maybe rebasing on the latest master would help fixing the build (since your PR is old) ?

@mikemeier
Copy link
Contributor Author

@greg0ire My current PR is a rebase of your master. That shouldnt be a problem.

@greg0ire
Copy link
Contributor

Indeed, it must be something else…

@greg0ire
Copy link
Contributor

This is what I call good commit messages! Don't anyone dare ask you to squash that!

@@ -45,6 +45,7 @@
"jms/di-extra-bundle": "~1.7",
"sensio/generator-bundle": "~2.3|~3.0",
"symfony/yaml": "~2.3|~3.0",
"phpunit/phpunit": "~4.3",
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't .travis.yml be changed to use vendor/bin/phpunit ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In your travis:
- composer global require phpunit/phpunit:@stable fabpot/php-cs-fixer --no-update
So I think it will use this version

Copy link
Contributor

Choose a reason for hiding this comment

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

Hmmm… @core23 @OskarStark do you know why we are using @stable instead of a fixed version. It's great to be stable, but we can still can get BC-breaks.

@mikemeier : you can use this in the meantime I guess.

Mike Meier added 3 commits April 11, 2016 16:33
This is needed, because some actual floating asserts in tests only work correctly with this specific precision of 8. If this setting is not provided, php will rely on the system's provided php.ini precision setting, which than will cause some failures in the tests.
More code coverage for Form components. Checks if children are accessible.
The property 'children' is not always accessible or even available because several implementations of other FormBuilders do not have this property.
Accessing private properties is never a good idea. Only rely on the given FormBuilderInterface.
@@ -45,6 +45,7 @@
"jms/di-extra-bundle": "~1.7",
"sensio/generator-bundle": "~2.3|~3.0",
"symfony/yaml": "~2.3|~3.0",
"phpunit/phpunit": "^5.3",
Copy link
Member

Choose a reason for hiding this comment

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

Why requiring phpunit? It's installed globally on Travis.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because I can! (Honest: Please see conversation on top of this site, behind this line "greg0ire and 1 other commented on an outdated diff 2 days ago") Dont know how to link direct to this.

@soullivaneuh
Copy link
Member

I'm going a little bit late, but what is the goal of this PR? A bugfix? Do you have a concrete use case?

@mikemeier
Copy link
Contributor Author

@soullivaneuh You guys accessing a private member variable on FormBuilder with Reflection, do you think thats a good idea?

(https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Form/FormBuilder.php, property "children")

This Bundle breaks already with Sonata: https://github.com/egeloen/IvoryOrderedFormBundle because it replaces the default FormBuilder (thats okay, because for this case, there is a Interface to implement). But this guy doesnt provide a property "children" -> break

@mikemeier
Copy link
Contributor Author

@soullivaneuh Also I'm providing a fixed precision php.ini value for unit tests, because some tests rely on an exact precision of 8 (comparing float values...)

@mikemeier
Copy link
Contributor Author

@soullivaneuh Last but not least, I enforce a concrete phpunit version in composer.json. Because phpunit is a tool, that should run on every developers machine. Either to check if the tests are good or/and to add new tests. How should I be able to run/write Tests, if I dont even know which phpunit you rely on?

@greg0ire greg0ire added the patch label Apr 13, 2016
@greg0ire
Copy link
Contributor

Tagged as patch because this brings no new features to the user, and does so in a BC way.

@soullivaneuh
Copy link
Member

Because phpunit is a tool, that should run on every developers machine.

As you said, phpunit is a tool, not a library. Except for very special cases (class conflicts for example), this should not be require on project dependencies. This bring a lots of useless dependencies not related to the bundle.

BTW, your system won't work on PHP < 5.5. Just updated Travis to use your phpunit and you will see.

@mikemeier
Copy link
Contributor Author

@greg0ire What means that tag exactly in your workflow now?

@soullivaneuh There is a difference between require and require-dev. phpunit should not be installed globally, as already mentioned by @greg0ire -> sebastianbergmann/phpunit#1757

Unfortunately there is no cool solution to provide different dependencies for different php-versions: composer/composer#4090

@soullivaneuh
Copy link
Member

@greg0ire What means that tag exactly in your workflow now?

patch mean this is for a patch version (e.g. 2.2.Z).

@soullivaneuh There is a difference between require and require-dev. phpunit should not be installed globally, as already mentioned by @greg0ire -> sebastianbergmann/phpunit#1757

This is the special case I was talking about. AFAIK, we don't have this issue here.

And BTW, a solution of this phpunit issue is available or under working for .phar file (have to retrieve the link...). So we can use .phar if we have this issue.

@mikemeier can you please remove this deps so we can merge the rest now?

@greg0ire
Copy link
Contributor

@greg0ire What means that tag exactly in your workflow now?

It is for us to now what semver number to bump when making a release.

@soullivaneuh
Copy link
Member

The related link for .phar: sebastianbergmann/phpunit#2015

@mikemeier
Copy link
Contributor Author

@greg0ire We're taking about removing commit #4f71e78 only, correct?

@greg0ire
Copy link
Contributor

Correct

@greg0ire
Copy link
Contributor

This bring a lots of useless dependencies not related to the bundle.

This is a good point : the tool could be written in java, it does not have much to do with the bundle. In fact, I think it should be a platform requirement, just like php >= 5.3, but this does not exist AFAIK

@greg0ire
Copy link
Contributor

LGTM @core23 @OskarStark

@soullivaneuh soullivaneuh merged commit 52d0169 into sonata-project:master Apr 13, 2016
@mikemeier
Copy link
Contributor Author

@greg0ire What is your current tagging strategy on sonata? Do you still use 2.X.Y where X stands for the symfony version you're supporting? Because thats not how it should be used... Thanks for merge @soullivaneuh

@greg0ire
Copy link
Contributor

We will release 2.4.0 and then start using semver. Big changes are coming.

@soullivaneuh
Copy link
Member

Do you still use 2.X.Y where X stands for the symfony version you're supporting? Because thats not how it should be used...

We never did like this AFAIK.

@mikemeier
Copy link
Contributor Author

@soullivaneuh

We never did like this AFAIK.

Then have a look at this: sonata-project/SonataMediaBundle#445

But you moved the BooleanType already from sonata admin bundle, and tagged it with 2.2.9 instead of 3.0.0? That was a BC, isnt it?

Answer:

@mikemeier in theory, you are right. However Sonata's versionning scheme does not respect this. 2.2 means the code is working with symfony2.2 and upper. Which of course, it is far from an ideal situation.

We cannot maintain too many branches, so just upgrade your code ...

by @rande

@greg0ire
Copy link
Contributor

@mikemeier : you are looking for this : #3053

@mikemeier
Copy link
Contributor Author

Nice to see that something's going on. Keep up the cool work!

@soullivaneuh
Copy link
Member

Then have a look at this: sonata-project/SonataMediaBundle#445

Well, this was before I start contributing on it. But I can ensure version management will not be like this anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants