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

New moodle.PHPUnit.TestCaseNames Sniff #161

Merged
merged 1 commit into from
Nov 29, 2021

Conversation

stronk7
Copy link
Member

@stronk7 stronk7 commented Nov 28, 2021

Sniff in charge of verifying various things related with PHPUnit
test cases names (files and classes and namespaces). Like:

  • Error: _test.php files missing any valid test case.
  • Error: incorrectly names test cases (not ended with _test[case]
  • Warning: test case classes not matching test case file names.
  • Error: found duplicate test case names.
  • Error: found test case name proposed for another test case.
  • Error: test case namespace not matching expected component namespace.
  • Warning: test case namespace missing, suggesting a correct one.
  • Error: found duplicate proposed test case names.
  • Error: found proposed test case name existing for another test case.

Practically covered with unit tests. And behat tests updated.

Also included, small modification to local_codechecker_testcase base
class that now, when an incorrect fixture file is passed, it fails
with error (previously it was exiting silently and was hard to
detect what was happening when a typo in the fixture name was used).

Sniff in charge of verifying various things related with PHPUnit
test cases names (files and classes and namespaces). Like:
- Error: _test.php files missing any valid test case.
- Error: incorrectly names test cases (not ended with _test[case]
- Warning: test case classes not matching test case file names.
- Error: found duplicate test case names.
- Error: found test case name proposed for another test case.
- Error: test case namespace not matching expected component namespace.
- Warning: test case namespace missing, suggesting a correct one.
- Error: found duplicate proposed test case names.
- Error: found proposed test case name existing for another test case.

Practically covered with unit tests. And behat tests updated.

Also included, small modification to local_codechecker_testcase base
class that now, when an incorrect fixture file is passed, it fails
with error (previously it was exiting silently and was hard to
detect what was happening when a typo in the fixture name was used).
@stronk7 stronk7 changed the title clearNew moodle.PHPUnit.TestCaseNames Sniff New moodle.PHPUnit.TestCaseNames Sniff Nov 28, 2021
@andrewnicols andrewnicols merged commit 7888944 into moodlehq:master Nov 29, 2021
@stronk7 stronk7 deleted the phpunit_testcase_names branch November 29, 2021 10:16
@stronk7
Copy link
Member Author

stronk7 commented Nov 29, 2021

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants