/** * @see HTTPS_Resource_Proxy::default_config() */ function test_default_config() { $default_config = HTTPS_Resource_Proxy::default_config(); $this->assertArrayHasKey('min_cache_ttl', $default_config); $this->assertArrayHasKey('customize_preview_only', $default_config); $this->assertArrayHasKey('logged_in_users_only', $default_config); $this->assertArrayHasKey('max_content_length', $default_config); }
/** * @param array $config */ public function __construct($config = array()) { // @todo If running unit tests, we can just skip adding this action $priority = 9; // because WP_Customize_Widgets::register_settings() happens at after_setup_theme priority 10 add_action('after_setup_theme', array($this, 'init'), $priority); parent::__construct(); // autoload classes and set $slug, $dir_path, and $dir_url vars $default_config = array('disable_widgets_init' => false, 'disable_widgets_factory' => false, 'active_modules' => array('non_autoloaded_widget_options' => !$this->is_wpcom_vip_prod(), 'widget_number_incrementing' => true, 'https_resource_proxy' => true, 'widget_posts' => true, 'optimized_widget_registration' => false, 'deferred_customize_widgets' => true), 'https_resource_proxy' => HTTPS_Resource_Proxy::default_config(), 'widget_posts' => Widget_Posts::default_config(), 'memory_limit' => '256M', 'max_memory_usage_percentage' => 0.75); $this->config = array_merge($default_config, $config); }