/** * @see HTTPS_Resource_Proxy::send_proxy_response() * @see HTTPS_Resource_Proxy::handle_proxy_request() */ function test_send_proxy_response_too_large() { $instance = new HTTPS_Resource_Proxy($this->plugin); add_filter('https_resource_proxy_filtering_enabled', '__return_true'); $this->filter_pre_http_request(array('body' => str_repeat('*', $instance->config('max_content_length') + 1))); $params = array('nonce' => wp_create_nonce(HTTPS_Resource_Proxy::MODULE_SLUG), 'host' => 'example.org', 'path' => '/main.js'); $r = $instance->send_proxy_response($params); $this->assertEquals(502, wp_remote_retrieve_response_code($r)); $this->assertEquals('Response Too Large', wp_remote_retrieve_response_message($r)); }