Issue #2785997 by chanderbhushan, faline, mallezie, dawehner, mr.baileys: Clean up guzzle declaration in core tests
parent
3cabea22ed
commit
11c92ce945
|
@ -52,8 +52,7 @@ class StatisticsAdminTest extends WebTestBase {
|
|||
$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 @@ class StatisticsLoggingTest extends WebTestBase {
|
|||
|
||||
// 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 @@ class StatisticsReportsTest extends StatisticsTestBase {
|
|||
$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 @@ class StatisticsTokenReplaceTest extends StatisticsTestBase {
|
|||
$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 @@ class IntegrationTest extends ViewTestBase {
|
|||
// @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');
|
||||
|
||||
|
|
Loading…
Reference in New Issue