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

Update deps and WPCS before release #1309

Merged
merged 7 commits into from
Mar 8, 2022
Merged

Update deps and WPCS before release #1309

merged 7 commits into from
Mar 8, 2022

Conversation

kasparsd
Copy link
Contributor

@kasparsd kasparsd commented Mar 8, 2022

  • Update Node and Composer deps.
  • WPCS formatting prior release.
  • Switch to MariaDB containers to make it compatible with ARM Macs.

@kasparsd
Copy link
Contributor Author

kasparsd commented Mar 8, 2022

Looks like #1264 made one of the unit tests for EDD fail:

  1. WP_Stream\Test_WP_Stream_Connector_EDD::test_log_override
    Failed asserting that 2 is identical to 4.

public function test_log_override() {
// Callback for validating expected log data.
$asserted = 0;
add_action(
'wp_stream_log_data',
function( $data ) use( &$asserted ) {
if ( 'edd' === $data['connector'] && in_array( $data['context'], array( 'downloads', 'discounts' ), true ) ) {
$asserted++;
}
return $data;
},
99
);
// Create download and discount to trigger logs.
$this->create_simple_download();
$this->create_simple_percent_discount();
// Check assertion flage
$this->assertSame( $asserted, 2 );
}

I'm not sure why the wp_stream_log_data is called twice for every post insert.

@@ -18,9 +18,6 @@ public function setUp() {

$this->plugin->connectors->unload_connectors();

$post_connector = new Connector_Posts();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was causing the wp_stream_log_data action to be called twice -- once for the EDD connector and once for the Posts connector and the test in this file was being run during both.

@kasparsd kasparsd merged commit 1b30829 into develop Mar 8, 2022
@kasparsd kasparsd deleted the fix/deps branch March 8, 2022 15:50
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.

1 participant