Make WordPress Core

Ticket #43438: 43438.21.diff

File 43438.21.diff, 1.9 KB (added by garrett-eclipse, 6 years ago)

Cleaned up the is_multisite() conditionals and a spacing issue.

  • tests/phpunit/tests/ajax/PrivacyErasePersonalData.php

     
    140140                add_filter( 'wp_privacy_personal_data_erasers', array( $this, 'register_custom_personal_data_eraser' ) );
    141141
    142142                $this->_setRole( 'administrator' );
     143                // erase_others_personal_data meta cap in Multisite installation is only granted to those with `manage_network` capability.
     144                if ( is_multisite() ) {
     145                        grant_super_admin( get_current_user_id() );
     146                }
    143147        }
    144148
    145149        /**
     
    149153                remove_filter( 'wp_privacy_personal_data_erasers', array( $this, 'register_custom_personal_data_eraser' ) );
    150154                $this->new_callback_value = '';
    151155
     156                if ( is_multisite() ) {
     157                        revoke_super_admin( get_current_user_id() );
     158                }
     159
    152160                parent::tearDown();
    153161        }
    154162
  • tests/phpunit/tests/ajax/PrivacyExportPersonalData.php

     
    154154                add_filter( 'wp_privacy_personal_data_exporters', array( $this, 'filter_register_custom_personal_data_exporter' ) );
    155155
    156156                $this->_setRole( 'administrator' );
     157                // export_others_personal_data meta cap in Multisite installation is only granted to those with `manage_network` capability.
     158                if ( is_multisite() ) {
     159                        grant_super_admin( get_current_user_id() );
     160                }
    157161        }
    158162
    159163        /**
     
    162166        public function tearDown() {
    163167                remove_filter( 'wp_privacy_personal_data_exporters', array( $this, 'filter_register_custom_personal_data_exporter' ) );
    164168
     169                if ( is_multisite() ) {
     170                        revoke_super_admin( get_current_user_id() );
     171                }
    165172                parent::tearDown();
    166173        }
    167174