Skip to content

Commit

Permalink
Merge pull request #1217 from xwp/devops/blog-connector-test-deprecat…
Browse files Browse the repository at this point in the history
…ed-fix

Mercator deprecated actions patched in Blogs connector test
  • Loading branch information
kidunot89 authored Jan 12, 2021
2 parents afef5a9 + 91d3f02 commit 9cb6c5e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
"type": "php",
"request": "launch",
"port": 9000,
"ignore": [
"vendor/"
],
"pathMappings": {
"/var/www/html/wp-content/plugins/stream-src": "${workspaceRoot}",
"/var/www/html/wp-content/plugins/stream": "${workspaceRoot}/build",
Expand Down
2 changes: 1 addition & 1 deletion connectors/class-connector-blogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function callback_wp_initialize_site( $new_site, $args ) {
/**
* A site has been deleted from the database.
*
* @action wp_deleted_site
* @action wp_delete_site
*
* @param WP_Site $old_site Deleted site object.
*/
Expand Down
6 changes: 5 additions & 1 deletion tests/tests/connectors/test-class-connector-blogs.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,11 @@ public function test_callback_wp_delete_site() {
);

// Delete blog to trigger callback.
\wp_delete_site( $blog_id );
// Fix Mercator actions.
remove_all_actions( 'delete_blog' );
add_action( 'wp_delete_blog', '\Mercator\clear_mappings_on_delete' );

wpmu_delete_blog( $blog_id, true );
$wpdb->suppress_errors( $suppress );

// Check callback test action.
Expand Down

0 comments on commit 9cb6c5e

Please sign in to comment.