Uname: Linux premium294.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
Software: LiteSpeed
PHP version: 8.1.32 [ PHP INFO ] PHP os: Linux
Server Ip: 104.21.96.1
Your Ip: 216.73.216.223
User: mjbynoyq (1574) | Group: mjbynoyq (1570)
Safe Mode: OFF
Disable Function:
NONE

name : util.php
<?php

class WPMUDEV_Dashboard_Test_Util {

	const WPMUDEV_API_KEY = '703cd83f1f7f929ebe5994207847e907ca1b3faa';

	public static $is_logged_in = false;

	public static function login() {
		WPMUDEV_Dashboard::$api->set_key( self::WPMUDEV_API_KEY );
		WPMUDEV_Dashboard::$api->hub_sync( false, true );
		self::$is_logged_in = true;
	}

	public static function logout() {
		if ( ! self::$is_logged_in ) {
			return;
		}
		WPMUDEV_Dashboard::$api->revoke_remote_access();
		WPMUDEV_Dashboard::$api->analytics_disable();
		WPMUDEV_Dashboard::$settings->reset();
		WPMUDEV_Dashboard::$api->set_key( '' );
		WPMUDEV_Dashboard::$api->hub_sync( false, true ); // force a sync so that site is removed from user's hub.
		self::$is_logged_in = false;
	}

	public static function open_json_data( $file_name ) {
		return file_get_contents( dirname( __FILE__ ) . '/data/' . $file_name );// phpcs:ignore WordPress.WP.AlternativeFunctions -- Internal usage for test purpose only
	}
}
© 2025 XylotrechusZ