Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Added more tests for PropertyAccess #16155

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
Oct 7, 2015

Conversation

pierredup
Copy link
Contributor

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

This is a follow up for 16090#issuecomment-145183635

$object->firstName = array('Bernhard');

$propertyAccessor->getValue($object, 'firstName[1]');
$this->assertSame(array('Bernhard'), $object->firstName);
Copy link
Contributor

Choose a reason for hiding this comment

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

this makes no sense as its not executed currently

Copy link
Contributor

Choose a reason for hiding this comment

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

you need to catch the exception if you want to test what the tests says

@pierredup pierredup force-pushed the property_access_test branch from be7b54d to 18759e1 Compare October 6, 2015 22:15
@pierredup pierredup force-pushed the property_access_test branch from 18759e1 to 378db75 Compare October 6, 2015 23:02
@fabpot
Copy link
Member

fabpot commented Oct 7, 2015

Thank you @pierredup.

@fabpot fabpot merged commit 378db75 into symfony:2.7 Oct 7, 2015
fabpot added a commit that referenced this pull request Oct 7, 2015
This PR was merged into the 2.7 branch.

Discussion
----------

Added more tests for PropertyAccess

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

This is a follow up for [16090#issuecomment-145183635](#16090 (comment))

Commits
-------

378db75 Added more tests for PropertyAccess
$object->firstName = array('Bernhard');

try {
$propertyAccessor->getValue($object, 'firstName[1]');
Copy link
Contributor

Choose a reason for hiding this comment

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

this is missing a fail() after wards. Otherwise the test also passed if the exception is not thrown which would be wrong.

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.

4 participants