Skip to content

[Form] add test for ArrayChoiceList handling null #17832

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
Feb 18, 2016

Conversation

Tobion
Copy link
Contributor

@Tobion Tobion commented Feb 17, 2016

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

I found this bug but then realised that it was already fixed in #17511.
So this just adds a test.

protected function setUp()
{
parent::setUp();

$this->object = new \stdClass();
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this was broken because it was initialized after getChoices is called. so $this->object was actually null.

Copy link
Contributor

Choose a reason for hiding this comment

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

You should maybe just put it before the call to parent::setUp() instead of removing it and keep using $this->object in getChoices()

@fabpot
Copy link
Member

fabpot commented Feb 18, 2016

Looks like this breaks the tests

@xabbuh
Copy link
Member

xabbuh commented Feb 18, 2016

Using assertSame() now doesn't work as the object isn't the same instance anymore.

@Tobion
Copy link
Contributor Author

Tobion commented Feb 18, 2016

Fixed

@HeahDude
Copy link
Contributor

👍

Status: Reviewed

@fabpot
Copy link
Member

fabpot commented Feb 18, 2016

Thank you @Tobion.

@fabpot fabpot merged commit 00e3819 into symfony:2.7 Feb 18, 2016
fabpot added a commit that referenced this pull request Feb 18, 2016
This PR was merged into the 2.7 branch.

Discussion
----------

[Form] add test for ArrayChoiceList handling null

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

I found this bug but then realised that it was already fixed in #17511.
So this just adds a test.

Commits
-------

00e3819 [Form] add test for ArrayChoiceList handling null
@Tobion Tobion deleted the fix-array-choice-list-with-null branch February 18, 2016 14:08
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.

5 participants