-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Coding Standards: Add visibility to methods in tests/phpunit/tests/ A-B-C-D files.
#1717
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
Conversation
19fb30b to
d6a3428
Compare
Note: In `tests/phpunit/tests/admin/includesTheme.php`: The `_theme_root()` method is used as a callback in `set_up()`. This has now been appropriately prefixed with `filter_` instead of `_`.
d6a3428 to
ff9b127
Compare
tests/phpunit/tests A-B-C-D files.tests/phpunit/tests/ A-B-C-D files.
|
@costdev Can you rebase with |
| class Tests_Functions_wpScriptTag extends WP_UnitTestCase { | ||
|
|
||
| function get_script_tag_type_set() { | ||
| public function get_script_tag_type_set() { |
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.
Hmm, this test needs a test_ in front of it for it run. Outside the scope of this ticket. But it needs to be fixed.
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.
👍 Also needs:
- A
$messagevalue for the two assertions or, ideally, a data provider. - A
@coverstag for::wp_get_script_tag. - Some work on the test as both assertions currently fail for the following reasons:
Test 1 - wp_get_script_tag() returns the attributes in the order they were supplied. The expected value has the attributes in a different order than it supplied to wp_get_script_tag().
Test 2 - wp_get_script_tag() calls wp_sanitize_script_attributes(). For boolean attributes, this returns attribute="attribute". The test supplies 'nomodule' => true and tests for nomodule, but gets nomodule="nomodule" instead. IMO, this should be part of a wider discussion in Core about the usage of attribute="attribute". However, that is beyond the scope of fixing that test, which just needs some minor corrections in the expected values.
hellofromtonya
left a comment
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.
Well done @costdev. Ready for commit.
|
Committed via https://core.trac.wordpress.org/changeset/52010. |
Coding Standards: Add visibility to methods in
tests/phpunit/tests/A-B-C-D files."Visibility should always be declared"
See: https://make.wordpress.org/core/2020/03/20/updating-the-coding-standards-for-modern-php/
This commit applies the following sniffs to files in
tests/phpunit/tests/A-B-C-D directories:For most methods, these now indicate
publicvisibility to avoid breaking backwards compatibility.Any remaining methods now indicate
privatevisibility where appropriate.Additional fixups in this PR:
Trac ticket: https://core.trac.wordpress.org/ticket/54177