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

Jetpack connector test implemented #1153

Merged
merged 4 commits into from
Mar 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"wp-phpunit/wp-phpunit": "^5.4",
"wpackagist-plugin/advanced-custom-fields": "5.8.12",
"wpackagist-plugin/easy-digital-downloads": "^2.9.23",
"wpackagist-plugin/jetpack": "^8.7",
"wpackagist-plugin/user-switching": "^1.5.5",
"wpsh/local": "^0.2.3"
},
Expand Down
113 changes: 69 additions & 44 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 9 additions & 5 deletions connectors/class-connector-jetpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,11 +318,16 @@ public function register() {
'label' => esc_html__( 'Tiled Galleries', 'stream' ),
'context' => 'tiled-gallery',
),
// Monitor.
'monitor_receive_notification' => array(
'label' => esc_html__( 'Monitor notifications', 'stream' ),
'context' => 'monitor',
),
);
}

/**
* Track Jetpack log entries
* Tracks logs add to Jetpack logging.
* Includes:
* - Activation/Deactivation of modules
* - Registration/Disconnection of blogs
Expand Down Expand Up @@ -374,11 +379,10 @@ public function callback_jetpack_log_entry( array $entry ) {
$action = $method;
$meta = compact( 'user_id', 'user_email', 'user_login' );
$message = sprintf(
/* translators: %1$s: a user display name, %2$s: a status, %3$s: the connection either "from" or "to" (e.g. "Jane Doe", "unlinked", "from") */
__( '%1$s\'s account %2$s %3$s Jetpack', 'stream' ),
/* translators: %1$s: a user display name, %2$s: a status and the connection either "from" or "to" (e.g. "Jane Doe", "unlinked from") */
__( '%1$s\'s account %2$s Jetpack', 'stream' ),
$user->display_name,
( 'unlink' === $action ) ? esc_html__( 'unlinked', 'stream' ) : esc_html__( 'linked', 'stream' ),
( 'unlink' === $action ) ? esc_html__( 'from', 'stream' ) : esc_html__( 'to', 'stream' )
( 'unlink' === $action ) ? esc_html__( 'unlinked from', 'stream' ) : esc_html__( 'linked to', 'stream' )
);
} elseif ( in_array( $method, array( 'register', 'disconnect', 'subsiteregister', 'subsitedisconnect' ), true ) ) {
$context = 'blogs';
Expand Down
3 changes: 2 additions & 1 deletion local/config/wp-config.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@

$table_prefix = 'wptests_';

define( 'WP_DEBUG', false );
define( 'WP_DEBUG', true );
define( 'JETPACK_DEV_DEBUG', true );

define( 'ABSPATH', __DIR__ . '/' );

Expand Down
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<php>
<const
name="WP_TEST_ACTIVATED_PLUGINS"
value="advanced-custom-fields/acf.php,easy-digital-downloads/easy-digital-downloads.php,user-switching/user-switching.php"
value="advanced-custom-fields/acf.php,easy-digital-downloads/easy-digital-downloads.php,jetpack/jetpack.php,user-switching/user-switching.php"
/>
</php>
<testsuites>
Expand Down