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

Skip to content

[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

Merged
merged 1 commit into from
Oct 1, 2015

Conversation

xabbuh
Copy link
Member

@xabbuh xabbuh commented Oct 1, 2015

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.

$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');
Copy link
Member

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

Copy link
Member Author

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?

Copy link
Member Author

Choose a reason for hiding this comment

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

test updated

Copy link
Member

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.
@xabbuh xabbuh force-pushed the css-selector-tests branch from 2559ba7 to 2b29a40 Compare October 1, 2015 17:39
@fabpot
Copy link
Member

fabpot commented Oct 1, 2015

Thank you @xabbuh.

@fabpot fabpot merged commit 2b29a40 into symfony:2.8 Oct 1, 2015
fabpot added a commit that referenced this pull request Oct 1, 2015
…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
@xabbuh xabbuh deleted the css-selector-tests branch October 1, 2015 19:17
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