-
Notifications
You must be signed in to change notification settings - Fork 55
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
Update PHP tests to follow WP core conventions. #666
Comments
I find it unpleasant that we — the WordPress Project in general — have decided to go with CamelCase filenames for tests when on the style guide we're giving emphasis to consistent naming. In essence, https://make.wordpress.org/docs/style-guide/formatting/filenames/#consistent-naming versus https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#test-classes If we were to vote on this, I'd go with https://make.wordpress.org/docs/style-guide/formatting/filenames, namely hyphenated lower case names, instead of a different file naming convention for tests. |
Yes, I agree with the hyphenated names. The camel case feels wrong surrounded by consistency everywhere else. I'm not a fan of the WordPress testing organization; one function per file/class, etc. I think the inconsistency started with the "WordPress organization style" was introduced, the 1:1 class/test was what was there initially. I'm trying to figure out of that just because "I've always done it differently" or of there's some other reason I'm not a fan of that structure. I learned to have a 1:1 relationship between test classes and what's tested as that seems an easier way to use TDD which is where I find value in tests while testing-after-development to ensure the code does what you expect which seems to be where this structure offers the most value. |
What?
Update PHP tests to follow WP core conventions.
Reference docs: https://make.wordpress.org/core/handbook/testing/automated-testing/writing-phpunit-tests/#test-classes
Reference source: https://github.com/WordPress/wordpress-develop/tree/trunk/tests/phpunit/tests/blocks
Why?
Some of the plugin tests in the plugin don't follow that convention.
Expected
All tests should follow the same convention.
The text was updated successfully, but these errors were encountered: