diff --git a/core/modules/statistics/src/Tests/StatisticsAdminTest.php b/core/modules/statistics/src/Tests/StatisticsAdminTest.php index 565925c0e51e604defc8a3b0889188ba84ed48d5..6d87fd975745f1a6b445e88e161e4637a413fd71 100644 --- a/core/modules/statistics/src/Tests/StatisticsAdminTest.php +++ b/core/modules/statistics/src/Tests/StatisticsAdminTest.php @@ -52,8 +52,7 @@ protected function setUp() { $this->privilegedUser = $this->drupalCreateUser(array('administer statistics', 'view post access counter', 'create page content')); $this->drupalLogin($this->privilegedUser); $this->testNode = $this->drupalCreateNode(array('type' => 'page', 'uid' => $this->privilegedUser->id())); - $this->client = \Drupal::service('http_client_factory') - ->fromOptions(['config/curl' => [CURLOPT_TIMEOUT => 10]]); + $this->client = \Drupal::httpClient(); } /** diff --git a/core/modules/statistics/src/Tests/StatisticsLoggingTest.php b/core/modules/statistics/src/Tests/StatisticsLoggingTest.php index 7cfec7cd8a3b90b36454e7d49fec8fee8a87a4be..9aa3cc3f9b6d2effb81eb270c0f2a82e148511b5 100644 --- a/core/modules/statistics/src/Tests/StatisticsLoggingTest.php +++ b/core/modules/statistics/src/Tests/StatisticsLoggingTest.php @@ -82,9 +82,7 @@ protected function setUp() { // Clear the logs. db_truncate('node_counter'); - - $this->client = \Drupal::service('http_client_factory') - ->fromOptions(['config/curl' => [CURLOPT_TIMEOUT => 10]]); + $this->client = \Drupal::httpClient(); } /** diff --git a/core/modules/statistics/src/Tests/StatisticsReportsTest.php b/core/modules/statistics/src/Tests/StatisticsReportsTest.php index 9c0d26c5963bd081e9f98500b45ed54222c38939..4028074128c9d415d8b8f92e7b0450e73287ada1 100644 --- a/core/modules/statistics/src/Tests/StatisticsReportsTest.php +++ b/core/modules/statistics/src/Tests/StatisticsReportsTest.php @@ -25,8 +25,7 @@ function testPopularContentBlock() { $headers = array('Content-Type' => 'application/x-www-form-urlencoded'); global $base_url; $stats_path = $base_url . '/' . drupal_get_path('module', 'statistics') . '/statistics.php'; - $client = \Drupal::service('http_client_factory') - ->fromOptions(['config/curl' => [CURLOPT_TIMEOUT => 10]]); + $client = \Drupal::httpClient(); $client->post($stats_path, array('headers' => $headers, 'body' => $post)); // Configure and save the block. diff --git a/core/modules/statistics/src/Tests/StatisticsTokenReplaceTest.php b/core/modules/statistics/src/Tests/StatisticsTokenReplaceTest.php index b7d22b8fe418a22efa7731f2bc82be0277de3f22..e2e4533d6f818ff274032f0092185b299adcec2f 100644 --- a/core/modules/statistics/src/Tests/StatisticsTokenReplaceTest.php +++ b/core/modules/statistics/src/Tests/StatisticsTokenReplaceTest.php @@ -28,8 +28,7 @@ function testStatisticsTokenReplacement() { $headers = array('Content-Type' => 'application/x-www-form-urlencoded'); global $base_url; $stats_path = $base_url . '/' . drupal_get_path('module', 'statistics') . '/statistics.php'; - $client = \Drupal::service('http_client_factory') - ->fromOptions(['config/curl' => [CURLOPT_TIMEOUT => 10]]); + $client = \Drupal::httpClient(); $client->post($stats_path, array('headers' => $headers, 'body' => $post)); $statistics = statistics_get($node->id()); diff --git a/core/modules/statistics/src/Tests/Views/IntegrationTest.php b/core/modules/statistics/src/Tests/Views/IntegrationTest.php index 07380c88922c2a66b4cb00e548a62cd06db25008..7fe99f93ef2646b6171ed35cd07bd8278afff90e 100644 --- a/core/modules/statistics/src/Tests/Views/IntegrationTest.php +++ b/core/modules/statistics/src/Tests/Views/IntegrationTest.php @@ -75,7 +75,7 @@ public function testNodeCounterIntegration() { // @see \Drupal\statistics\Tests\StatisticsLoggingTest::testLogging(). global $base_url; $stats_path = $base_url . '/' . drupal_get_path('module', 'statistics') . '/statistics.php'; - $client = \Drupal::service('http_client_factory')->fromOptions(['config/curl', array(CURLOPT_TIMEOUT => 10)]); + $client = \Drupal::httpClient(); $client->post($stats_path, array('form_params' => array('nid' => $this->node->id()))); $this->drupalGet('test_statistics_integration');