controller ) { $this->endpoint = new $this->controller(); } if ( ! $this->bp ) { $this->bp = new BP_UnitTestCase(); } if ( $this->handle ) { $this->endpoint_url = '/' . bp_rest_namespace() . '/' . bp_rest_version() . '/' . $this->handle; } if ( ! $this->server ) { $this->server = rest_get_server(); } $admin = static::factory()->user->create_and_get( array( 'role' => 'administrator', 'user_email' => 'admin@example.com', ) ); $this->user = $admin->ID; if ( is_multisite() ) { grant_super_admin( $this->user ); $admin->add_cap( 'manage_network_users' ); } } }