function test_jetpack_constants_can_clear_single_constant_when_null() { Jetpack_Constants::set_constant('TEST', null); $this->assertCount(1, Jetpack_Constants::$set_constants); Jetpack_Constants::clear_single_constant('TEST'); $this->assertEmpty(Jetpack_Constants::$set_constants); }
/** * Returns the value of the jetpack_sync_idc_optin filter, or constant. * If set to true, the site will be put into staging mode. * * @since 4.3.2 * @return bool */ public static function sync_idc_optin() { if (Jetpack_Constants::is_defined('JETPACK_SYNC_IDC_OPTIN')) { $default = Jetpack_Constants::get_constant('JETPACK_SYNC_IDC_OPTIN'); } else { $default = !Jetpack_Constants::is_defined('SUNRISE') && !is_multisite(); } /** * Allows sites to optin to IDC mitigation which blocks the site from syncing to WordPress.com when the home * URL or site URL do not match what WordPress.com expects. The default value is either false, or the value of * JETPACK_SYNC_IDC_OPTIN constant if set. * * @since 4.3.2 * * @param bool $default Whether the site is opted in to IDC mitigation. */ return (bool) apply_filters('jetpack_sync_idc_optin', $default); }
function test_is_dev_version_false_with_number_dot_number_dot_number() { Jetpack_Constants::set_constant('JETPACK__VERSION', '4.3.1'); $this->assertFalse(Jetpack::is_development_version()); }
/** * Resets all of the constants within Jetpack_Constants. */ public static function clear_constants() { self::$set_constants = array(); }