Changeset 12017 for sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-profiles-wp-activity-notifier/tests/e2e.php
- Timestamp:
- 08/12/2022 09:13:41 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-profiles-wp-activity-notifier/tests/e2e.php
r11892 r12017 9 9 10 10 namespace WordPressdotorg\Activity_Notifier\Tests; 11 use WPOrg_WP_Activity_Notifier ;11 use WPOrg_WP_Activity_Notifier, WP_User; 12 12 13 13 ini_set( 'display_errors', 'On' ); // won't do anything if fatal errors … … 52 52 } 53 53 54 function test_ post( WPOrg_WP_Activity_Notifier $notifier ) : void {54 function test_new_post( WPOrg_WP_Activity_Notifier $notifier ) : void { 55 55 if ( defined( 'IS_WORDCAMP_NETWORK' ) && IS_WORDCAMP_NETWORK ) { 56 56 $notifier->maybe_notify_new_published_post( 'publish', 'draft', get_post( 1 ) ); // post … … 69 69 } 70 70 71 function test_update_handbook( WPOrg_WP_Activity_Notifier $notifier, WP_User $user ) : void { 72 // WordCamp.org doesn't use the Handbook plugin. 73 if ( defined( 'IS_WORDCAMP_NETWORK' ) && IS_WORDCAMP_NETWORK ) { 74 return; 75 } 76 77 wp_set_current_user( $user->ID ); 78 79 // This should notify 80 $handbook = get_post( 1849 ); 81 $notifier->maybe_notify_updated_post( $handbook->ID, $handbook, $handbook ); 82 83 sleep( 1 ); // buddypress doesn't show activity that happens at the exact same time 84 85 // This should not notify 86 $regular_post = get_post( 1879 ); // `post` post type. 87 $notifier->maybe_notify_updated_post( $regular_post->ID, $regular_post, $regular_post ); 88 } 89 71 90 function test_comment( WPOrg_WP_Activity_Notifier $notifier ) : void { 72 91 if ( defined( 'IS_WORDCAMP_NETWORK' ) && IS_WORDCAMP_NETWORK ) {
Note: See TracChangeset
for help on using the changeset viewer.