Skip to content
Snippets Groups Projects
Commit b2e49105 authored by Angie Byron's avatar Angie Byron
Browse files

Issue #1912568 by typhonius, Berdir: Convert drupal_http_request() usage in...

Issue #1912568 by typhonius, Berdir: Convert drupal_http_request() usage in SearchRankingTest.php to Guzzle.
parent 258dbd6d
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
...@@ -80,13 +80,13 @@ function testRankings() { ...@@ -80,13 +80,13 @@ function testRankings() {
// Then View one of the nodes a bunch of times. // Then View one of the nodes a bunch of times.
// Manually calling statistics.php, simulating ajax behavior. // Manually calling statistics.php, simulating ajax behavior.
$client = \Drupal::httpClient();
$client->setConfig(array('curl.options' => array(CURLOPT_TIMEOUT => 10)));
$nid = $nodes['views'][1]->nid; $nid = $nodes['views'][1]->nid;
$post = http_build_query(array('nid' => $nid));
$headers = array('Content-Type' => 'application/x-www-form-urlencoded');
global $base_url; global $base_url;
$stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php'; $stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php';
for ($i = 0; $i < 5; $i ++) { for ($i = 0; $i < 5; $i ++) {
drupal_http_request($stats_path, array('method' => 'POST', 'data' => $post, 'headers' => $headers, 'timeout' => 10000)); $client->post($stats_path, array(), array('nid' => $nid))->send();
} }
// Test each of the possible rankings. // Test each of the possible rankings.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment