Issue #2785997 by chanderbhushan, faline, mallezie, dawehner, mr.baileys: Clean up guzzle declaration in core tests

8.3.x
xjm 2016-11-29 18:58:32 -06:00
parent 3cabea22ed
commit 11c92ce945
5 changed files with 5 additions and 10 deletions

View File

@ -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();
}
/**

View File

@ -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();
}
/**

View File

@ -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.

View File

@ -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());

View File

@ -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');