Making WordPress.org


Ignore:
Timestamp:
05/13/2022 06:33:14 PM (4 years ago)
Author:
iandunn
Message:

Profiles: Adjust paths and test data for WordCamp.org.

Props ryelle

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  
    2323
    2424function 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
    2631    require_once dirname( __DIR__ ) . '/wporg-profiles-wp-activity-notifier.php';
    2732
     
    4853
    4954function 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    }
    5565}
    5666
    5767function 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 ) );
    5975}
Note: See TracChangeset for help on using the changeset viewer.