Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
08/24/2019 02:53:10 PM (5 years ago)
Author:
imath
Message:

Anticipate the deprecation in WordPress 5.3 of update_user_status()

Introduce bp_core_update_member_status() in order to wrap wp_update_user() with needed argument to spam a user on multisite configurations.

Props espellcaste

Fixes #8123

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/testcases/members/functions.php

    r12423 r12450  
    379379        }
    380380
    381         if ( is_multisite() && function_exists( 'wp_get_registered_image_subsizes' ) ) {
    382             $this->setExpectedDeprecated( 'update_user_status' );
    383         }
    384 
    385381        $bp = buddypress();
    386382        $displayed_user = $bp->displayed_user;
     
    390386
    391387        // Bulk spam in network admin uses update_user_status
    392         update_user_status( $u1, 'spam', '1' );
     388        bp_core_update_member_status( $u1, '1' );
    393389
    394390        $this->assertTrue( bp_is_user_spammer( $u1 ) );
     
    411407        }
    412408
    413         if ( is_multisite() && function_exists( 'wp_get_registered_image_subsizes' ) ) {
    414             $this->setExpectedDeprecated( 'update_user_status' );
    415         }
    416 
    417409        $bp = buddypress();
    418410        $displayed_user = $bp->displayed_user;
     
    427419
    428420        // Bulk unspam in network admin uses update_user_status
    429         update_user_status( $u1, 'spam', '0' );
     421        bp_core_update_member_status( $u1, '0' );
    430422
    431423        $this->assertFalse( bp_is_user_spammer( $u1 ) );
     
    439431     */
    440432    public function test_bp_core_process_spammer_status_make_spam_user_filter() {
    441         if ( is_multisite() && function_exists( 'wp_get_registered_image_subsizes' ) ) {
    442             $this->setExpectedDeprecated( 'update_user_status' );
    443         }
    444 
    445433        add_filter( 'make_spam_user', array( $this, 'notification_filter_callback' ) );
    446434
     
    455443
    456444    public function test_bp_core_process_spammer_status_make_ham_user_filter() {
    457         if ( is_multisite() && function_exists( 'wp_get_registered_image_subsizes' ) ) {
    458             $this->setExpectedDeprecated( 'update_user_status' );
    459         }
     445        $u1 = self::factory()->user->create();
     446        $s  = bp_core_process_spammer_status( $u1, 'spam' );
    460447
    461448        add_filter( 'make_ham_user', array( $this, 'notification_filter_callback' ) );
    462449
    463         $u1 = self::factory()->user->create();
    464         $n = bp_core_process_spammer_status( $u1, 'ham' );
     450        $h = bp_core_process_spammer_status( $u1, 'ham' );
    465451
    466452        remove_filter( 'make_ham_user', array( $this, 'notification_filter_callback' ) );
     
    471457
    472458    public function test_bp_core_process_spammer_status_bp_make_spam_user_filter() {
    473         if ( is_multisite() && function_exists( 'wp_get_registered_image_subsizes' ) ) {
    474             $this->setExpectedDeprecated( 'update_user_status' );
    475         }
    476 
    477459        add_filter( 'bp_make_spam_user', array( $this, 'notification_filter_callback' ) );
    478460
     
    487469
    488470    public function test_bp_core_process_spammer_status_bp_make_ham_user_filter() {
    489         if ( is_multisite() && function_exists( 'wp_get_registered_image_subsizes' ) ) {
    490             $this->setExpectedDeprecated( 'update_user_status' );
    491         }
    492 
    493471        add_filter( 'bp_make_ham_user', array( $this, 'notification_filter_callback' ) );
    494472
Note: See TracChangeset for help on using the changeset viewer.