-
Notifications
You must be signed in to change notification settings - Fork 794
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
Updated PHPCS: Packages and Debugger #17617
Conversation
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.
Here are some suggested test cases for this PR.
Connection
- In-place connection with free plan
- In-place connection with paid plan
- In-place connection with product purchase
- Classic connection. Use Safari, or set a constant
JETPACK_SHOULD_NOT_USE_CONNECTION_IFRAME
to true - Disconnect/reconnect connection
- Secondary user connection
- Connection on multisite
Verify that the changes are compatible with the plugins that use the connection package.
- WooCommerce Payments
- Jetpack Boost
- Previous versions of Jetpack
If you think that suggestions should be improved please edit the configuration file here. You can also modify/add test-suites to be used in the configuration file.
After 9.1 branches off and #17406 merges, we need to update base branch to |
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.
Changes look sane to me. None of the comments I left are anything I'd hold up approval on.
@@ -156,7 +155,7 @@ public function test_jetpack_constants_get_constant_use_filter_value() { | |||
$apply_filters_spy = new Spy( | |||
'Automattic\Jetpack', | |||
'apply_filters', | |||
function ( $filter_name, $value, $name ) use ( $test_constant_value ) { | |||
function ( $filter_name, $value, $name ) use ( $test_constant_value ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable |
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.
Could just remove the unused variables here, if you want.
I wouldn't recommend that for actual methods intended for being passed as callbacks, but this is just a closure.
@@ -62,11 +62,11 @@ public function test_store_error() { | |||
|
|||
$stored_errors = $this->error_handler->get_stored_errors(); | |||
|
|||
$this->assertEquals( 1, count( $stored_errors ) ); | |||
$this->assertSame( 1, count( $stored_errors ) ); |
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.
Random thought: Maybe we should have a sniff to prefer assertCount
over things like this.
@@ -204,7 +204,7 @@ public static function update_settings( $new_settings ) { | |||
} | |||
|
|||
// If we set the disabled option to true, clear the queues. | |||
if ( ( 'disable' === $setting || 'network_disable' === $setting ) && ! ! $value ) { | |||
if ( ( 'disable' === $setting || 'network_disable' === $setting ) && (bool) $value ) { |
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.
We could drop the (bool)
entirely, PHP implicitly casts to bool in this situation anyway.
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.
Ugh, Github. It did change the branch to master, but still thinks it wants to apply all the patches from #17406 as part of this patch. Currently when this gets squash-and-merged those will wind up going away, but I have to wonder what would happen if some other patch touching those files got merged in the mean time.
Scheduled Jetpack release: November 10, 2020. E2E results is available here (for debugging purposes): https://jetpack-e2e-dashboard.herokuapp.com/pr-17617 Thank you for the great PR description! When this PR is ready for review, please apply the |
After #17406, updated the "requiredlist" files to match new PHPCS rules for packages and the debugger.
Changes proposed in this Pull Request:
Jetpack product discussion
n/a
Does this pull request change what data or activity we track or use?
n/a
Testing instructions:
n/a
Proposed changelog entry for your changes: