Skip to content

[PropertyAccess] Fail the test if the exception was not thrown on accessing an invalid element #16223

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

Closed
wants to merge 1 commit into from

Conversation

jakzal
Copy link
Contributor

@jakzal jakzal commented Oct 13, 2015

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 followup to Tobion's comment on #16155 .

@@ -148,6 +148,8 @@ public function testGetValueNotModifyObjectException()

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

$this->fail('Expected an exception to be thrown when accessing an invalid element.');
Copy link
Contributor

Choose a reason for hiding this comment

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

If you remove the try catch, you could make a separate test with an @expectedException for this case

Copy link
Contributor Author

Choose a reason for hiding this comment

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

There's a separate test case for this already. I just realised there's no need to test this again here.

@jakzal jakzal closed this Oct 13, 2015
@jakzal jakzal deleted the property-access-test branch September 26, 2017 10:42
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