diff -u b/core/includes/common.inc b/core/includes/common.inc --- b/core/includes/common.inc +++ b/core/includes/common.inc @@ -128,13 +128,6 @@ const JS_THEME = 100; /** - * Error code indicating that the request exceeded the specified timeout. - * - * @see drupal_http_request() - */ -const HTTP_REQUEST_TIMEOUT = -1; - -/** * @defgroup block_caching Block Caching * @{ * Constants that define each block's caching state. only in patch2: unchanged: --- a/core/modules/statistics/lib/Drupal/statistics/Tests/Views/IntegrationTest.php +++ b/core/modules/statistics/lib/Drupal/statistics/Tests/Views/IntegrationTest.php @@ -81,11 +81,11 @@ public function testNodeCounterIntegration() { // Manually calling statistics.php, simulating ajax behavior. // @see \Drupal\statistics\Tests\StatisticsLoggingTest::testLogging(). $post = http_build_query(array('nid' => $this->node->id())); - $headers = array('Content-Type' => 'application/x-www-form-urlencoded'); global $base_url; $stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php'; - drupal_http_request($stats_path, array('method' => 'POST', 'data' => $post, 'headers' => $headers, 'timeout' => 10000)); - + $client = \Drupal::httpClient(); + $client->setConfig(array('curl.options' => array(CURLOPT_TIMEOUT => 10))); + $client->post($stats_path, array(), $post)->send(); $this->drupalGet('test_statistics_integration'); $expected = statistics_get($this->node->id());