Commit b2e49105 authored by webchick's avatar webchick

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
......@@ -80,13 +80,13 @@ function testRankings() {
// Then View one of the nodes a bunch of times.
// Manually calling statistics.php, simulating ajax behavior.
$client = \Drupal::httpClient();
$client->setConfig(array('curl.options' => array(CURLOPT_TIMEOUT => 10)));
$nid = $nodes['views'][1]->nid;
$post = http_build_query(array('nid' => $nid));
$headers = array('Content-Type' => 'application/x-www-form-urlencoded');
global $base_url;
$stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php';
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.
......
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