8000 [Form] Fix reverseTransform on multiple entity form type by chmielot · Pull Request #3734 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Form] Fix reverseTransform on multiple entity form type #3734

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

Merged
merged 1 commit into from
Apr 7, 2012

Conversation

chmielot
Copy link

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3446, #3727
Todo: -

public function testReverseTransformEmptyArray()
{
$this->assertSame(array(), $this->transformer->reverseTransform(array()));
}
Copy link

Choose a reason for hiding this comment

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

Your test does not cover the issue. In fact, the DataTransformer is only tested with the SimpleChoiceList and not all the classes implementing the ChoiceListInterface interface. If you try to execute your new test without your fix, the test suite still passes.

To test the issue reported in #3727 isn't caracterized by your unit test. To reproduce the bug, you'd need to initialize the $this->transformer with an EntityChoiceList. However, this classe belong to the DoctrineBridge, so I'm unsure on where to put this test.

@stof
Copy link
Member
stof commented Apr 3, 2012

@bschussek ping

@stof
Copy link
Member
stof commented Apr 3, 2012

This is an alternate implementation for #3727

@chmielot
Copy link
Author
chmielot commented Apr 4, 2012

OK, this is another possibility to fix this issue with working tests. What do you think about this?

@@ -25,7 +26,7 @@ class EntityChoiceListTest extends DoctrineOrmTestCase
const SINGLE_IDENT_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\SingleIdentEntity';

const COMPOSITE_IDENT_CLASS = 'Symfony\Bridge\Doctrine\Tests\Fixtures\CompositeIdentEntity';

Copy link
Member

Choose a reason for hiding this comment

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

this line should be removed

@chmielot
Copy link
Author
chmielot commented Apr 4, 2012

OK, just done.

@stof
Copy link
Member
stof commented Apr 4, 2012

@beberlei @bschussek ping

@webmozart
Copy link
Contributor

@fabpot 👍

fabpot added a commit that referenced this pull request Apr 7, 2012
Commits
-------

a430f3d [#3446] [Form] Fix getChoicesForValues of EntityChoiceList on empty values

Discussion
----------

[Form] Fix reverseTransform on multiple entity form type

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3446, #3727
Todo: -

---------------------------------------------------------------------------

by stof at 2012-04-03T23:05:55Z

@bschussek ping

---------------------------------------------------------------------------

by stof at 2012-04-03T23:06:45Z

This is an alternate implementation for #3727

---------------------------------------------------------------------------

by chmielot at 2012-04-04T13:47:27Z

OK, this is another possibility to fix this issue with working tests. What do you think about this?

---------------------------------------------------------------------------

by chmielot at 2012-04-04T13:51:27Z

OK, just done.

---------------------------------------------------------------------------

by stof at 2012-04-04T13:51:39Z

@beberlei @bschussek ping

---------------------------------------------------------------------------

by bschussek at 2012-04-06T18:50:37Z

@fabpot 👍
@fabpot fabpot merged commit a430f3d into symfony:master Apr 7, 2012
@guilhermeblanco
Copy link
Contributor

@fabpot @bschussek is it possible to have this merged in 2.0 branch aswell?

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.

6 participants
0