Changeset 11846 for sites/trunk/wordpress.org/public_html/wp-content/plugins/wporg-profiles-wp-activity-notifier/tests/e2e.php
- Timestamp:
- 05/13/2022 06:33:14 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
r11845 r11846 23 23 24 24 function main( string $case ) : void { 25 switch_to_blog( 11 ); // make.w.org/test-site 25 if ( defined( 'IS_WORDCAMP_NETWORK' ) && IS_WORDCAMP_NETWORK ) { 26 switch_to_blog( 1056 ); // testing.wordcamp.org/2019 27 } else { 28 switch_to_blog( 11 ); // make.w.org/test-site 29 } 30 26 31 require_once dirname( __DIR__ ) . '/wporg-profiles-wp-activity-notifier.php'; 27 32 … … 48 53 49 54 function test_post( WPOrg_WP_Activity_Notifier $notifier ) : void { 50 $notifier->maybe_notify_new_published_post( 'publish', 'draft', get_post( 1802 ) ); // post 51 sleep( 1 ); // buddypress don't show activity that happens at the exact same time 52 $notifier->maybe_notify_new_published_post( 'publish', 'draft', get_post( 1826 ) ); // handbook 53 sleep( 1 ); 54 $notifier->maybe_notify_new_published_post( 'publish', 'draft', get_post( 1832 ) ); // course 55 if ( defined( 'IS_WORDCAMP_NETWORK' ) && IS_WORDCAMP_NETWORK ) { 56 $notifier->maybe_notify_new_published_post( 'publish', 'draft', get_post( 1 ) ); // post 57 58 } else { 59 $notifier->maybe_notify_new_published_post( 'publish', 'draft', get_post( 1802 ) ); // post 60 sleep( 1 ); // buddypress doesn't show activity that happens at the exact same time 61 $notifier->maybe_notify_new_published_post( 'publish', 'draft', get_post( 1826 ) ); // handbook 62 sleep( 1 ); 63 $notifier->maybe_notify_new_published_post( 'publish', 'draft', get_post( 1832 ) ); // course 64 } 55 65 } 56 66 57 67 function test_comment( WPOrg_WP_Activity_Notifier $notifier ) : void { 58 $notifier->insert_comment( 224, get_comment( 224 ) ); 68 if ( defined( 'IS_WORDCAMP_NETWORK' ) && IS_WORDCAMP_NETWORK ) { 69 $comment_id = 1; 70 } else { 71 $comment_id = 224; 72 } 73 74 $notifier->insert_comment( $comment_id, get_comment( $comment_id ) ); 59 75 }
Note: See TracChangeset
for help on using the changeset viewer.