-
-
Notifications
You must be signed in to change notification settings - Fork 60
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
Tests/Ruleset: introduce an abstract base TestCase and start using it #702
Conversation
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.
LGTM!
I just have one question that is not a blocker. Instead of creating an abstract base class for the ruleset tests, have you considered creating a more generic abstract base class that can be used by other tests as well?
I imagine that having those PHPUnit cross-version compatible methods will be useful for other tests. For example, there are already a few places in the PHPCS code base that check whether to use expectException()
or setExpectedException()
:
There is even AbstractMethodUnitTest::expectRunTimeException()
:
Introduce an abstract base TestCase with some helper methods specifically for tests testing aspects of the `Ruleset` class.
Start using the new `AbstractRulesetTestCase` in pre-existing `Ruleset` tests.
6911355
to
db02f0d
Compare
Good question. Originally (while working on this series) this base test case contained some more Ruleset specific methods, which is why I introduced it as a Ruleset specific test case. On that note, I just noticed the I did consider introducing a more generic As most of that work to drop support for PHPUnit < 8 is already in the 4.x branch, it would also make merging a PR which introduced a generic All in all, I decided that introducing this Does that make sense ? |
That makes sense. Thanks for the additional details! |
Description
Tests/Ruleset: introduce an abstract base TestCase
Introduce an abstract base TestCase with some helper methods specifically for tests testing aspects of the
Ruleset
class.Tests/Ruleset: start using the new AbstractRulesetTestCase
Start using the new
AbstractRulesetTestCase
in pre-existingRuleset
tests.Suggested changelog entry
N/A
Related issues/external references
This is a preliminary PR for a series of PRs expanding the tests for the
Ruleset
class.