-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Deprecate multiple test case classes in a single file #4105
Labels
Milestone
Comments
sebastianbergmann
added
feature/test-runner
CLI test runner
type/deprecation
Something will be/is deprecated
and removed
type/enhancement
A new idea that should be implemented
labels
Feb 17, 2020
Go ahead. Thanks! |
realFlowControl
added a commit
to realFlowControl/phpunit
that referenced
this issue
Feb 19, 2020
realFlowControl
added a commit
to realFlowControl/phpunit
that referenced
this issue
Feb 19, 2020
realFlowControl
added a commit
to realFlowControl/phpunit
that referenced
this issue
Feb 19, 2020
sebastianbergmann
pushed a commit
that referenced
this issue
Mar 31, 2020
Closed
stronk7
added a commit
to stronk7/moodle
that referenced
this issue
Mar 11, 2021
Custom autoloaders are deprecated with PHPUnit 9 and will be removed with PHPUnit 10. Since PHPUnit 8.5 custom autoloaders don't do much because that version removed the ability to launch unit tests by class name and that's exactly the reason we had a custom autoloader (to map class names to files within our tests). See MDL-67673 about when direct use of classes was deprecated (8.5), now removed (9.5). So, as far as it's unused, removing it now, test still can be selectively using any of: - a relative path to file (although there are some restrictions comming with PHPUnit 9, see sebastianbergmann/phpunit#4105 - using --filter, to point to any classname[::method] - using --testsuite to run a complete suite - using --config to point to custom components. Also, commented out the lib/ajax/tests directory because it doesn't exist / is empty and PHPUnit 9 emits error when a configured test directory does not exist. See sebastianbergmann/phpunit#4493. Alternative was to completely remove the configuration line, but decided to keep it around in case some day we want to add some test there.
stronk7
added a commit
to stronk7/moodle
that referenced
this issue
Mar 11, 2021
Custom autoloaders are deprecated with PHPUnit 9 and will be removed with PHPUnit 10. Since PHPUnit 8.5 custom autoloaders don't do much because that version removed the ability to launch unit tests by class name and that's exactly the reason we had a custom autoloader (to map class names to files within our tests). See MDL-67673 about when direct use of classes was deprecated (8.5), now removed (9.5). So, as far as it's unused, removing it now, test still can be selectively using any of: - a relative path to file (although there are some restrictions comming with PHPUnit 9, see sebastianbergmann/phpunit#4105 - using --filter, to point to any classname[::method] - using --testsuite to run a complete suite - using --config to point to custom components. Also, commented out the lib/ajax/tests directory because it doesn't exist / is empty and PHPUnit 9 emits error when a configured test directory does not exist. See sebastianbergmann/phpunit#4493. Alternative was to completely remove the configuration line, but decided to keep it around in case some day we want to add some test there.
sj-i
added a commit
to sj-i/iseven.php
that referenced
this issue
Aug 25, 2021
athos-ribeiro
added a commit
to athos-ribeiro/BaconQrCode
that referenced
this issue
Jun 24, 2023
Having phpunit test classes not matching their file names has been deprecated since phpunit 9 and was removed in phpunit 10. * sebastianbergmann/phpunit#4105 * sebastianbergmann/phpunit#4621 (comment)
athos-ribeiro
added a commit
to athos-ribeiro/BaconQrCode
that referenced
this issue
Jun 24, 2023
Having phpunit test classes not matching their file names has been deprecated since phpunit 9 and was removed in phpunit 10. * sebastianbergmann/phpunit#4105 * sebastianbergmann/phpunit#4621 (comment) * Fixes: Bacon#97
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Hey there,
it is stated in the ChangeLog-9.0.md file that
This is only true for files included directly as in:
but it is still possible to have multiple and randomly named test classes in that
FooTest.php
when invoked viaThis is because invoking with a directory (or suite from
config.xml
) theStandardSuiteLoader
is not used.Proposal: I would create a PR that deprecates this behavior and prints out warnings if the file has more than one test case class in it or the test case class is not named like the filename as it is already behaving when invoking with a filename.
Very curious on your opinion.
/Flo
The text was updated successfully, but these errors were encountered: