Skip to content
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: rename base class and make abstract #1590

Merged
merged 1 commit into from Aug 3, 2023

Conversation

jrfnl
Copy link
Member

@jrfnl jrfnl commented Jul 29, 2023

The BaseSniffTest class, which is used as a basis for all test classes, should by rights be an abstract class as it doesn't contain any tests itself.

However, using the Test suffix for abstract test case classes is deprecated since PHPUnit 9.6.

Even though this wasn't causing us any problems so far (as the class wasn't abstract), let's tidy this up to future-proof PHPUnit cross-version compatibility.

So, in this commit:

  • The BaseSniffTest class is renamed to BaseSniffTestCase, including updating the file name to match.
  • All test classes which extend the class have been updated to now extend the BaseSniffTestCase.

Ref: sebastianbergmann/phpunit#5132

The `BaseSniffTest` class, which is used as a basis for all test classes, should by rights be an `abstract` class as it doesn't contain any tests itself.

However, using the `Test` suffix for abstract test case classes is deprecated since PHPUnit 9.6.

Even though this wasn't causing us any problems so far (as the class wasn't `abstract`), let's tidy this up to future-proof PHPUnit cross-version compatibility.

So, in this commit:
* The `BaseSniffTest` class is renamed to `BaseSniffTestCase`, including updating the file name to match.
* All test classes which `extend` the class have been updated to now extend the `BaseSniffTestCase`.

Ref: sebastianbergmann/phpunit#5132
@jrfnl jrfnl added chores/QA PR: quick merge PR only contains relatively simple changes PR: ready for review labels Jul 29, 2023
@jrfnl jrfnl added this to the 10.0.0 milestone Jul 29, 2023
@jrfnl jrfnl requested a review from wimg July 29, 2023 00:32
@wimg wimg merged commit 00391c5 into develop Aug 3, 2023
43 checks passed
@wimg wimg deleted the feature/tests-rename-base-test-class-to-testcase branch August 3, 2023 21:45
@github-actions github-actions bot removed PR: ready for review PR: quick merge PR only contains relatively simple changes labels Aug 3, 2023
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.

None yet

3 participants