-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[CssSelector] synchronize tests for static and non-static API #16052
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
Conversation
$this->fail('->parse() throws an Exception if the css selector is not valid'); | ||
} catch (\Exception $e) { | ||
$this->assertInstanceOf('\Symfony\Component\CssSelector\Exception\ParseException', $e, '->parse() throws an Exception if the css selector is not valid'); | ||
$this->assertEquals('Expected identifier, but <eof at 3> found.', $e->getMessage(), '->parse() throws an Exception if the css selector is not valid'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be turned into a @expectedException
IMO (and a @expectedExceptionMessage
instead of catching all exceptions (including from ->fail()
) and then asserting
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually I would agree. Though do you know why it was done this way originally?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test updated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably legacy from early attempts at using PHPUnit
Synchronizing the classes ensures that no tests are lost when the legacy API is removed in symfony#16020 for Symfony 3.0, thus mitigating the risk of future regressions.
2559ba7
to
2b29a40
Compare
Thank you @xabbuh. |
…c API (xabbuh) This PR was merged into the 2.8 branch. Discussion ---------- [CssSelector] synchronize tests for static and non-static API | Q | A | ------------- | --- | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | Synchronizing the classes ensures that no tests are lost when the legacy API is removed in #16020 for Symfony 3.0, thus mitigating the risk of future regressions. Commits ------- 2b29a40 synchronize tests for static and non-static API
Synchronizing the classes ensures that no tests are lost when the legacy
API is removed in #16020 for Symfony 3.0, thus mitigating the risk of
future regressions.