diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc index d8b54af..d4316b6 100644 --- a/core/includes/install.core.inc +++ b/core/includes/install.core.inc @@ -1604,8 +1604,7 @@ function install_retrieve_file($uri, $destination) { */ function install_check_localization_server($uri) { try { - $request = \Drupal::httpClient()->head($uri); - $request->send(); + \Drupal::httpClient()->head($uri); return TRUE; } catch (RequestException $e) { diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php index 89606bc..d6dfbab 100644 --- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php +++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsAdminTest.php @@ -86,16 +86,16 @@ function testStatisticsSettings() { $post = array('nid' => $nid); global $base_url; $stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php'; - $this->client->post($stats_path, array(), $post)->send(); + $this->client->post($stats_path, array(), $post); // Hit the node again (the counter is incremented after the hit, so // "1 view" will actually be shown when the node is hit the second time). $this->drupalGet('node/' . $this->test_node->id()); - $this->client->post($stats_path, array(), $post)->send(); + $this->client->post($stats_path, array(), $post); $this->assertText('1 view', 'Node is viewed once.'); $this->drupalGet('node/' . $this->test_node->id()); - $this->client->post($stats_path, array(), $post)->send(); + $this->client->post($stats_path, array(), $post); $this->assertText('2 views', 'Node is viewed 2 times.'); } @@ -111,7 +111,7 @@ function testDeleteNode() { $post = array('nid' => $nid); global $base_url; $stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php'; - $this->client->post($stats_path, array(), $post)->send(); + $this->client->post($stats_path, array(), $post); $result = db_select('node_counter', 'n') ->fields('n', array('nid')) @@ -145,9 +145,9 @@ function testExpiredLogs() { $post = array('nid' => $nid); global $base_url; $stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php'; - $this->client->post($stats_path, array(), $post)->send(); + $this->client->post($stats_path, array(), $post); $this->drupalGet('node/' . $this->test_node->id()); - $this->client->post($stats_path, array(), $post)->send(); + $this->client->post($stats_path, array(), $post); $this->assertText('1 view', 'Node is viewed once.'); // statistics_cron() will subtract diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php index f30a69a..a2704d8 100644 --- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php +++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsLoggingTest.php @@ -93,7 +93,7 @@ function testLogging() { // Manually call statistics.php to simulate ajax data collection behavior. $nid = $this->node->id(); $post = array('nid' => $nid); - $this->client->post($stats_path, array(), $post)->send(); + $this->client->post($stats_path, array(), $post); $node_counter = statistics_get($this->node->id()); $this->assertIdentical($node_counter['totalcount'], '1'); } diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsReportsTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsReportsTest.php index 9f90a27..fed4bdc 100644 --- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsReportsTest.php +++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsReportsTest.php @@ -38,7 +38,7 @@ function testPopularContentBlock() { $stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php'; $client = \Drupal::httpClient(); $client->setDefaultOption('config/curl', array(CURLOPT_TIMEOUT => 10)); - $client->post($stats_path, $headers, $post)->send(); + $client->post($stats_path, $headers, $post); // Configure and save the block. $this->drupalPlaceBlock('statistics_popular_block', array( diff --git a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php index e6d17cb..e692173 100644 --- a/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php +++ b/core/modules/statistics/lib/Drupal/statistics/Tests/StatisticsTokenReplaceTest.php @@ -42,7 +42,7 @@ function testStatisticsTokenReplacement() { $stats_path = $base_url . '/' . drupal_get_path('module', 'statistics'). '/statistics.php'; $client = \Drupal::httpClient(); $client->setDefaultOption('config/curl', array(CURLOPT_TIMEOUT => 10)); - $client->post($stats_path, $headers, $post)->send(); + $client->post($stats_path, $headers, $post); $statistics = statistics_get($node->id()); // Generate and test tokens. diff --git a/core/modules/system/system.module b/core/modules/system/system.module index 06082ac..f84a6c6 100644 --- a/core/modules/system/system.module +++ b/core/modules/system/system.module @@ -1682,7 +1682,6 @@ function system_retrieve_file($url, $destination = NULL, $managed = FALSE, $repl try { $data = \Drupal::httpClient() ->get($url) - ->send() ->getBody(TRUE); $local = $managed ? file_save_data($data, $path, $replace) : file_unmanaged_save_data($data, $path, $replace); } diff --git a/core/tests/Drupal/Tests/Core/Cache/CacheContextsTest.php b/core/tests/Drupal/Tests/Core/Cache/CacheContextsTest.php index 6e5864d..e430965 100644 --- a/core/tests/Drupal/Tests/Core/Cache/CacheContextsTest.php +++ b/core/tests/Drupal/Tests/Core/Cache/CacheContextsTest.php @@ -9,6 +9,7 @@ use Drupal\Core\Cache\CacheContexts; use Drupal\Core\Cache\CacheContextInterface; +use Drupal\Tests\UnitTestCase; /** * Fake cache context class. @@ -38,7 +39,7 @@ public function getContext() { * * @see \Drupal\Core\Cache\CacheContexts */ -class CacheContextsTest extends \PHPUnit_Framework_TestCase { +class CacheContextsTest extends UnitTestCase { public static function getInfo() { return array(