Commit 11c92ce9 authored by xjm's avatar xjm

Issue #2785997 by chanderbhushan, faline, mallezie, dawehner, mr.baileys:...

Issue #2785997 by chanderbhushan, faline, mallezie, dawehner, mr.baileys: Clean up guzzle declaration in core tests
parent 3cabea22
......@@ -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();
}
/**
......
......@@ -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();
}
/**
......
......@@ -30,8 +30,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.
......
......@@ -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());
......
......@@ -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');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment