diff --git a/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php
index fd9d254..63b00b0 100644
--- a/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/Views/DisplayBlockTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\block\Tests\Views;
 
+use Drupal\Component\Utility\Json;
 use Drupal\Component\Utility\String;
 use Drupal\views\Tests\ViewTestBase;
 use Drupal\views\Tests\ViewTestData;
@@ -271,8 +272,8 @@ public function testBlockContextualLinks() {
     $post = array('ids[0]' => $id);
     $response = $this->drupalPost('contextual/render', 'application/json', $post, array('query' => array('destination' => 'test-page')));
     $this->assertResponse(200);
-    $json = drupal_json_decode($response);
-    $this->assertIdentical($json[$id], '<ul class="contextual-links"><li class="block-configure odd first"><a href="' . base_path() . 'admin/structure/block/manage/' . $block->id() . '?destination=test-page">Configure block</a></li><li class="views-uiedit even last"><a href="' . base_path() . 'admin/structure/views/view/test_view_block/edit/block_1?destination=test-page">Edit view</a></li></ul>');
+    $json = Json::decode($response);
+    $this->assertIdentical($json[$id], '<ul class="contextual-links"><li class="block-configure odd first"><a href="' . base_path() . 'admin/structure/block/manage/' . $block->id() . '?destination=test-page">Configure block</a></li><li class="views-ui-edit even last"><a href="' . base_path() . 'admin/structure/views/view/test_view_block/edit/block_1?destination=test-page">Edit view</a></li></ul>');
   }
 
 }
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentNewIndicatorTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentNewIndicatorTest.php
index cdf658a..c55cc8f 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentNewIndicatorTest.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentNewIndicatorTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\comment\Tests;
 
+use Drupal\Component\Utility\Json;
 use Drupal\Core\Language\Language;
 
 /**
@@ -114,7 +115,7 @@ public function testCommentNewCommentsIndicator() {
     $this->assertIdentical(1, count($this->xpath('//*[@data-history-node-field-name="comment"]')), 'data-history-node-field-name attribute is set to the correct value.');
     $response = $this->renderNewCommentsNodeLinks(array($this->node->id()));
     $this->assertResponse(200);
-    $json = drupal_json_decode($response);
+    $json = Json::decode($response);
     $expected = array($this->node->id() => array(
       'new_comment_count' => 1,
       'first_new_comment_link' => url('node/' . $this->node->id(), array('fragment' => 'new')),
diff --git a/core/modules/contextual/contextual.module b/core/modules/contextual/contextual.module
index d9d20b5..87992a9 100644
--- a/core/modules/contextual/contextual.module
+++ b/core/modules/contextual/contextual.module
@@ -7,6 +7,7 @@
 
 use Drupal\Component\Utility\Url;
 use Drupal\Core\Template\Attribute;
+use Drupal\Component\Utility\Json;
 
 /**
  * Implements hook_menu().
@@ -308,7 +309,7 @@ function contextual_pre_render_links($element) {
 function contextual_contextual_links_view_alter(&$element, $items) {
   if (isset($element['#contextual_links']['contextual'])) {
     $encoded_links = $element['#contextual_links']['contextual']['metadata']['contextual-views-field-links'];
-    $element['#links'] = drupal_json_decode(rawurldecode($encoded_links));
+    $element['#links'] = Json::decode(rawurldecode($encoded_links));
   }
 }
 
diff --git a/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualDynamicContextTest.php b/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualDynamicContextTest.php
index de44610..10f9cf0 100644
--- a/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualDynamicContextTest.php
+++ b/core/modules/contextual/lib/Drupal/contextual/Tests/ContextualDynamicContextTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\contextual\Tests;
 
+use Drupal\Component\Utility\Json;
 use Drupal\simpletest\WebTestBase;
 use Drupal\Core\Template\Attribute;
 
@@ -77,7 +78,7 @@ function testDifferentPermissions() {
     $this->assertRaw('No contextual ids specified.');
     $response = $this->renderContextualLinks($ids, 'node');
     $this->assertResponse(200);
-    $json = drupal_json_decode($response);
+    $json = Json::decode($response);
     $this->assertIdentical($json[$ids[0]], '<ul class="contextual-links"><li class="nodepage-edit odd first last"><a href="' . base_path() . 'node/1/edit?destination=node">Edit</a></li></ul>');
     $this->assertIdentical($json[$ids[1]], '');
     $this->assertIdentical($json[$ids[2]], '<ul class="contextual-links"><li class="nodepage-edit odd first last"><a href="' . base_path() . 'node/3/edit?destination=node">Edit</a></li></ul>');
@@ -94,7 +95,7 @@ function testDifferentPermissions() {
     $this->assertRaw('No contextual ids specified.');
     $response = $this->renderContextualLinks($ids, 'node');
     $this->assertResponse(200);
-    $json = drupal_json_decode($response);
+    $json = Json::decode($response);
     $this->assertIdentical($json[$ids[0]], '');
     $this->assertIdentical($json[$ids[1]], '');
     $this->assertIdentical($json[$ids[2]], '');
diff --git a/core/modules/edit/lib/Drupal/edit/Tests/EditLoadingTest.php b/core/modules/edit/lib/Drupal/edit/Tests/EditLoadingTest.php
index 914c0e4..a68defc 100644
--- a/core/modules/edit/lib/Drupal/edit/Tests/EditLoadingTest.php
+++ b/core/modules/edit/lib/Drupal/edit/Tests/EditLoadingTest.php
@@ -10,6 +10,7 @@
 use Drupal\simpletest\WebTestBase;
 use Drupal\edit\Ajax\MetadataCommand;
 use Drupal\Core\Ajax\AppendCommand;
+use Drupal\Component\Utility\Json;
 use Drupal\Component\Utility\Unicode;
 
 /**
@@ -159,7 +160,7 @@ public function testUserWithPermission() {
         'aria' => 'Entity node 1, field Body',
       )
     );
-    $this->assertIdentical(drupal_json_decode($response), $expected, 'The metadata HTTP request answers with the correct JSON response.');
+    $this->assertIdentical(Json::decode($response), $expected, 'The metadata HTTP request answers with the correct JSON response.');
     // Restore drupalSettings to build the next requests; simpletest wipes them
     // after a JSON response.
     $this->drupalSettings = $htmlPageDrupalSettings;
@@ -169,7 +170,7 @@ public function testUserWithPermission() {
     //  2. an insert command that loads the required in-place editors
     $post = array('editors[0]' => 'form') + $this->getAjaxPageStatePostData();
     $response = $this->drupalPost('edit/attachments', 'application/vnd.drupal-ajax', $post);
-    $ajax_commands = drupal_json_decode($response);
+    $ajax_commands = Json::decode($response);
     $this->assertIdentical(2, count($ajax_commands), 'The attachments HTTP request results in two AJAX commands.');
     // First command: settings.
     $this->assertIdentical('settings', $ajax_commands[0]['command'], 'The first AJAX command is a settings command.');
@@ -183,7 +184,7 @@ public function testUserWithPermission() {
     $post = array('nocssjs' => 'true', 'reset' => 'true') + $this->getAjaxPageStatePostData();
     $response = $this->drupalPost('edit/form/' . 'node/1/body/und/full', 'application/vnd.drupal-ajax', $post);
     $this->assertResponse(200);
-    $ajax_commands = drupal_json_decode($response);
+    $ajax_commands = Json::decode($response);
     $this->assertIdentical(1, count($ajax_commands), 'The field form HTTP request results in one AJAX command.');
     $this->assertIdentical('editFieldForm', $ajax_commands[0]['command'], 'The first AJAX command is an editFieldForm command.');
     $this->assertIdentical('<form ', Unicode::substr($ajax_commands[0]['data'], 0, 6), 'The editFieldForm command contains a form.');
@@ -212,7 +213,7 @@ public function testUserWithPermission() {
       // updated entity in TempStore on the server.
       $response = $this->drupalPost('edit/form/' . 'node/1/body/und/full', 'application/vnd.drupal-ajax', $post);
       $this->assertResponse(200);
-      $ajax_commands = drupal_json_decode($response);
+      $ajax_commands = Json::decode($response);
       $this->assertIdentical(1, count($ajax_commands), 'The field form HTTP request results in one AJAX command.');
       $this->assertIdentical('editFieldFormSaved', $ajax_commands[0]['command'], 'The first AJAX command is an editFieldFormSaved command.');
       $this->assertTrue(strpos($ajax_commands[0]['data'], 'Fine thanks.'), 'Form value saved and printed back.');
@@ -225,7 +226,7 @@ public function testUserWithPermission() {
       $post = array('nocssjs' => 'true');
       $response = $this->drupalPost('edit/entity/' . 'node/1', 'application/json', $post);
       $this->assertResponse(200);
-      $ajax_commands = drupal_json_decode($response);
+      $ajax_commands = Json::decode($response);
       $this->assertIdentical(1, count($ajax_commands), 'The entity submission HTTP request results in one AJAX command.');
       $this->assertIdentical('editEntitySaved', $ajax_commands[0]['command'], 'The first AJAX command is an editEntitySaved command.');
       $this->assertIdentical($ajax_commands[0]['data']['entity_type'], 'node', 'Saved entity is of type node.');
@@ -250,7 +251,7 @@ public function testUserWithPermission() {
       $post = array('nocssjs' => 'true', 'reset' => 'true');
       $response = $this->drupalPost('edit/form/' . 'node/1/body/und/full', 'application/vnd.drupal-ajax', $post);
       $this->assertResponse(200);
-      $ajax_commands = drupal_json_decode($response);
+      $ajax_commands = Json::decode($response);
       $this->assertIdentical(1, count($ajax_commands), 'The field form HTTP request results in one AJAX command.');
       $this->assertIdentical('editFieldForm', $ajax_commands[0]['command'], 'The first AJAX command is an editFieldForm command.');
       $this->assertIdentical('<form ', Unicode::substr($ajax_commands[0]['data'], 0, 6), 'The editFieldForm command contains a form.');
@@ -269,7 +270,7 @@ public function testUserWithPermission() {
       // @todo Uncomment the below once https://drupal.org/node/2063303 is fixed.
       // $this->assertIdentical('[]', $response);
       $this->assertResponse(200);
-      $ajax_commands = drupal_json_decode($response);
+      $ajax_commands = Json::decode($response);
       $this->assertIdentical(1, count($ajax_commands), 'The field form HTTP request results in one AJAX command.');
       $this->assertIdentical('editFieldFormSaved', $ajax_commands[0]['command'], 'The first AJAX command is an editFieldFormSaved command.');
       $this->assertTrue(strpos($ajax_commands[0]['data'], 'kthxbye'), 'Form value saved and printed back.');
diff --git a/core/modules/editor/lib/Drupal/editor/Tests/EditIntegrationLoadingTest.php b/core/modules/editor/lib/Drupal/editor/Tests/EditIntegrationLoadingTest.php
index 17d1d69..a66a461 100644
--- a/core/modules/editor/lib/Drupal/editor/Tests/EditIntegrationLoadingTest.php
+++ b/core/modules/editor/lib/Drupal/editor/Tests/EditIntegrationLoadingTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\editor\Tests;
 
+use Drupal\Component\Utility\Json;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -113,7 +114,7 @@ public function testUserWithPermission() {
 
     $response = $this->drupalPost('editor/' . 'node/1/body/und/full', 'application/vnd.drupal-ajax', array());
     $this->assertResponse(200);
-    $ajax_commands = drupal_json_decode($response);
+    $ajax_commands = Json::decode($response);
     $this->assertIdentical(1, count($ajax_commands), 'The untransformed text POST request results in one AJAX command.');
     $this->assertIdentical('editorGetUntransformedText', $ajax_commands[0]['command'], 'The first AJAX command is an editorGetUntransformedText command.');
     $this->assertIdentical('<p>Do you also love Drupal?</p><img src="druplicon.png" data-caption="Druplicon" />', $ajax_commands[0]['data'], 'The editorGetUntransformedText command contains the expected data.');
diff --git a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAutocompleteTest.php b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAutocompleteTest.php
index 9895368..56fb1f1 100644
--- a/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAutocompleteTest.php
+++ b/core/modules/entity_reference/lib/Drupal/entity_reference/Tests/EntityReferenceAutocompleteTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\entity_reference\Tests;
 
+use Drupal\Component\Utility\Json;
 use Drupal\entity_reference\EntityReferenceController;
 use Drupal\system\Tests\Entity\EntityUnitTestBase;
 
@@ -131,6 +132,6 @@ protected function getAutocompleteResult($type, $input) {
     $entity_reference_controller = EntityReferenceController::create($this->container);
     $result = $entity_reference_controller->handleAutocomplete($request, $type, $this->fieldName, $this->entityType, $this->bundle, 'NULL')->getContent();
 
-    return drupal_json_decode($result);
+    return Json::decode($result);
   }
 }
diff --git a/core/modules/history/lib/Drupal/history/Tests/HistoryTest.php b/core/modules/history/lib/Drupal/history/Tests/HistoryTest.php
index 84356f2..88d3866 100644
--- a/core/modules/history/lib/Drupal/history/Tests/HistoryTest.php
+++ b/core/modules/history/lib/Drupal/history/Tests/HistoryTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\history\Tests;
 
+use Drupal\Component\Utility\Json;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -117,7 +118,7 @@ function testHistory() {
     // Retrieve "last read" timestamp for test node, for the current user.
     $response = $this->getNodeReadTimestamps(array($nid));
     $this->assertResponse(200);
-    $json = drupal_json_decode($response);
+    $json = Json::decode($response);
     $this->assertIdentical(array(1 => 0), $json, 'The node has not yet been read.');
 
     // View the node.
@@ -130,13 +131,13 @@ function testHistory() {
     // Simulate JavaScript: perform HTTP request to mark node as read.
     $response = $this->markNodeAsRead($nid);
     $this->assertResponse(200);
-    $timestamp = drupal_json_decode($response);
+    $timestamp = Json::decode($response);
     $this->assertTrue(is_numeric($timestamp), 'Node has been marked as read. Timestamp received.');
 
     // Retrieve "last read" timestamp for test node, for the current user.
     $response = $this->getNodeReadTimestamps(array($nid));
     $this->assertResponse(200);
-    $json = drupal_json_decode($response);
+    $json = Json::decode($response);
     $this->assertIdentical(array(1 => $timestamp), $json, 'The node has been read.');
 
     // Failing to specify node IDs for the first endpoint should return a 404.
diff --git a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php
index f4f9e53..39ce718 100644
--- a/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php
+++ b/core/modules/menu/lib/Drupal/menu/Tests/MenuTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\menu\Tests;
 
+use Drupal\Component\Utility\Json;
+
 /**
  * Defines a test class for testing menu and menu link functionality.
  */
@@ -417,7 +419,7 @@ public function testBlockContextualLinks() {
     $post = array('ids[0]' => $id);
     $response =  $this->drupalPost('contextual/render', 'application/json', $post, array('query' => array('destination' => 'test-page')));
     $this->assertResponse(200);
-    $json = drupal_json_decode($response);
+    $json = Json::decode($response);
     $this->assertIdentical($json[$id], '<ul class="contextual-links"><li class="block-configure odd first"><a href="' . base_path() . 'admin/structure/block/manage/' . $block->id() . '?destination=test-page">Configure block</a></li><li class="menu-edit even last"><a href="' . base_path() . 'admin/structure/menu/manage/tools?destination=test-page">Edit menu</a></li></ul>');
   }
 
diff --git a/core/modules/rest/lib/Drupal/rest/Tests/CreateTest.php b/core/modules/rest/lib/Drupal/rest/Tests/CreateTest.php
index 749337c..17f2200 100644
--- a/core/modules/rest/lib/Drupal/rest/Tests/CreateTest.php
+++ b/core/modules/rest/lib/Drupal/rest/Tests/CreateTest.php
@@ -7,6 +7,9 @@
 
 namespace Drupal\rest\Tests;
 
+use Drupal\Component\Utility\Json;
+use Drupal\rest\Tests\RESTTestBase;
+
 /**
  * Tests resource creation on user, node and test entities.
  */
@@ -105,7 +108,7 @@ public function testCreate() {
       $invalid_serialized = $serializer->serialize($entity, $this->defaultFormat);
       $response = $this->httpRequest('entity/' . $entity_type, 'POST', $invalid_serialized, $this->defaultMimeType);
       $this->assertResponse(422);
-      $error = drupal_json_decode($response);
+      $error = Json::decode($response);
       $this->assertEqual($error['error'], "Unprocessable Entity: validation failed.\nuuid.0.value: This value is too long. It should have <em class=\"placeholder\">128</em> characters or less.\n");
 
       // Try to create an entity without proper permissions.
diff --git a/core/modules/rest/lib/Drupal/rest/Tests/DBLogTest.php b/core/modules/rest/lib/Drupal/rest/Tests/DBLogTest.php
index f3e0eda..53e5ed7 100644
--- a/core/modules/rest/lib/Drupal/rest/Tests/DBLogTest.php
+++ b/core/modules/rest/lib/Drupal/rest/Tests/DBLogTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\rest\Tests;
 
+use Drupal\Component\Utility\Json;
 use Drupal\rest\Tests\RESTTestBase;
 
 /**
@@ -53,7 +54,7 @@ public function testWatchdog() {
     $response = $this->httpRequest("dblog/$id", 'GET', NULL, $this->defaultMimeType);
     $this->assertResponse(200);
     $this->assertHeader('content-type', $this->defaultMimeType);
-    $log = drupal_json_decode($response);
+    $log = Json::decode($response);
     $this->assertEqual($log['wid'], $id, 'Log ID is correct.');
     $this->assertEqual($log['type'], 'rest_test', 'Type of log message is correct.');
     $this->assertEqual($log['message'], 'Test message', 'Log message text is correct.');
@@ -61,7 +62,7 @@ public function testWatchdog() {
     // Request an unknown log entry.
     $response = $this->httpRequest("dblog/9999", 'GET', NULL, $this->defaultMimeType);
     $this->assertResponse(404);
-    $decoded = drupal_json_decode($response);
+    $decoded = Json::decode($response);
     $this->assertEqual($decoded['error'], 'Log entry with ID 9999 was not found', 'Response message is correct.');
   }
 }
diff --git a/core/modules/rest/lib/Drupal/rest/Tests/DeleteTest.php b/core/modules/rest/lib/Drupal/rest/Tests/DeleteTest.php
index 10695c4..aec525d 100644
--- a/core/modules/rest/lib/Drupal/rest/Tests/DeleteTest.php
+++ b/core/modules/rest/lib/Drupal/rest/Tests/DeleteTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\rest\Tests;
 
+use Drupal\Component\Utility\Json;
 use Drupal\rest\Tests\RESTTestBase;
 
 /**
@@ -61,7 +62,7 @@ public function testDelete() {
       // Try to delete an entity that does not exist.
       $response = $this->httpRequest('entity/' . $entity_type . '/9999', 'DELETE');
       $this->assertResponse(404);
-      $decoded = drupal_json_decode($response);
+      $decoded = Json::decode($response);
       $this->assertEqual($decoded['error'], 'Entity with ID 9999 not found', 'Response message is correct.');
 
       // Try to delete an entity without proper permissions.
diff --git a/core/modules/rest/lib/Drupal/rest/Tests/ReadTest.php b/core/modules/rest/lib/Drupal/rest/Tests/ReadTest.php
index 8160f74..7ddde9d 100644
--- a/core/modules/rest/lib/Drupal/rest/Tests/ReadTest.php
+++ b/core/modules/rest/lib/Drupal/rest/Tests/ReadTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\rest\Tests;
 
+use Drupal\Component\Utility\Json;
 use Drupal\Core\Language\Language;
 use Drupal\rest\Tests\RESTTestBase;
 
@@ -53,7 +54,7 @@ public function testRead() {
       $response = $this->httpRequest('entity/' . $entity_type . '/' . $entity->id(), 'GET', NULL, $this->defaultMimeType);
       $this->assertResponse('200', 'HTTP response code is correct.');
       $this->assertHeader('content-type', $this->defaultMimeType);
-      $data = drupal_json_decode($response);
+      $data = Json::decode($response);
       // Only assert one example property here, other properties should be
       // checked in serialization tests.
       $this->assertEqual($data['uuid'][0]['value'], $entity->uuid(), 'Entity UUID is correct');
@@ -65,7 +66,7 @@ public function testRead() {
       // Try to read an entity that does not exist.
       $response = $this->httpRequest('entity/' . $entity_type . '/9999', 'GET', NULL, $this->defaultMimeType);
       $this->assertResponse(404);
-      $decoded = drupal_json_decode($response);
+      $decoded = Json::decode($response);
       $this->assertEqual($decoded['error'], 'Entity with ID 9999 not found', 'Response message is correct.');
 
       // Make sure that field level access works and that the according field is
@@ -77,7 +78,7 @@ public function testRead() {
         $response = $this->httpRequest('entity/' . $entity_type . '/' . $entity->id(), 'GET', NULL, $this->defaultMimeType);
         $this->assertResponse(200);
         $this->assertHeader('content-type', $this->defaultMimeType);
-        $data = drupal_json_decode($response);
+        $data = Json::decode($response);
         $this->assertFalse(isset($data['field_test_text']), 'Field access protected field is not visible in the response.');
       }
 
@@ -85,14 +86,14 @@ public function testRead() {
       $this->drupalLogout();
       $response = $this->httpRequest('entity/' . $entity_type . '/' . $entity->id(), 'GET', NULL, $this->defaultMimeType);
       $this->assertResponse(403);
-      $this->assertNull(drupal_json_decode($response), 'No valid JSON found.');
+      $this->assertNull(Json::decode($response), 'No valid JSON found.');
     }
     // Try to read a resource which is not REST API enabled.
     $account = $this->drupalCreateUser();
     $this->drupalLogin($account);
     $response = $this->httpRequest('entity/user/' . $account->id(), 'GET', NULL, $this->defaultMimeType);
     $this->assertResponse(404);
-    $this->assertNull(drupal_json_decode($response), 'No valid JSON found.');
+    $this->assertNull(Json::decode($response), 'No valid JSON found.');
   }
 
   /**
diff --git a/core/modules/rest/lib/Drupal/rest/Tests/UpdateTest.php b/core/modules/rest/lib/Drupal/rest/Tests/UpdateTest.php
index 11359b4..f2a5069 100644
--- a/core/modules/rest/lib/Drupal/rest/Tests/UpdateTest.php
+++ b/core/modules/rest/lib/Drupal/rest/Tests/UpdateTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\rest\Tests;
 
+use Drupal\Component\Utility\Json;
 use Drupal\rest\Tests\RESTTestBase;
 
 /**
@@ -147,7 +148,7 @@ public function testPatchUpdate() {
     $invalid_serialized = $serializer->serialize($entity, $this->defaultFormat);
     $response = $this->httpRequest('entity/' . $entity_type . '/' . $entity->id(), 'PATCH', $invalid_serialized, $this->defaultMimeType);
     $this->assertResponse(422);
-    $error = drupal_json_decode($response);
+    $error = Json::decode($response);
     $this->assertEqual($error['error'], "Unprocessable Entity: validation failed.\nuuid.0.value: This value is too long. It should have <em class=\"placeholder\">128</em> characters or less.\n");
 
     // Try to update an entity without proper permissions.
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
index 219762f..fa07d33 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/WebTestBase.php
@@ -8,6 +8,7 @@
 namespace Drupal\simpletest;
 
 use Drupal\Component\Utility\Crypt;
+use Drupal\Component\Utility\Json;
 use Drupal\Component\Utility\NestedArray;
 use Drupal\Component\Utility\String;
 use Drupal\Core\DrupalKernel;
@@ -1353,7 +1354,7 @@ protected function drupalGet($path, array $options = array(), array $headers = a
    */
   protected function drupalGetJSON($path, array $options = array(), array $headers = array()) {
     $headers[] = 'Accept: application/json';
-    return drupal_json_decode($this->drupalGet($path, $options, $headers));
+    return Json::decode($this->drupalGet($path, $options, $headers));
   }
 
   /**
@@ -1361,7 +1362,7 @@ protected function drupalGetJSON($path, array $options = array(), array $headers
    */
   protected function drupalGetAJAX($path, array $options = array(), array $headers = array()) {
     $headers[] = 'Accept: application/vnd.drupal-ajax';
-    return drupal_json_decode($this->drupalGet($path, $options, $headers));
+    return Json::decode($this->drupalGet($path, $options, $headers));
   }
 
   /**
@@ -1634,7 +1635,7 @@ protected function drupalPostAjaxForm($path, $edit, $triggering_element, $ajax_p
     }
 
     // Submit the POST request.
-    $return = drupal_json_decode($this->drupalPostForm(NULL, $edit, array('path' => $ajax_path, 'triggering_element' => $triggering_element), $options, $headers, $form_html_id, $extra_post));
+    $return = Json::decode($this->drupalPostForm(NULL, $edit, array('path' => $ajax_path, 'triggering_element' => $triggering_element), $options, $headers, $form_html_id, $extra_post));
 
     // Change the page content by applying the returned commands.
     if (!empty($ajax_settings) && !empty($return)) {
@@ -2480,7 +2481,7 @@ protected function drupalSetContent($content, $url = 'internal:') {
     $this->elements = FALSE;
     $this->drupalSettings = array();
     if (preg_match('/var drupalSettings = (.*?);$/m', $content, $matches)) {
-      $this->drupalSettings = drupal_json_decode($matches[1]);
+      $this->drupalSettings = Json::decode($matches[1]);
     }
   }
 
diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php
index 3a11ccc..e2f3fd0 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Common/JavaScriptTest.php
@@ -9,6 +9,7 @@
 
 use Drupal\simpletest\DrupalUnitTestBase;
 use Drupal\Component\Utility\Crypt;
+use Drupal\Component\Utility\Json;
 
 /**
  * Tests the JavaScript system.
@@ -190,7 +191,7 @@ function testHeaderSetting() {
     $start = strpos($javascript, $startToken) + strlen($startToken);
     $end = strrpos($javascript, $endToken);
     $json  = drupal_substr($javascript, $start, $end - $start + 1);
-    $parsed_settings = drupal_json_decode($json);
+    $parsed_settings = Json::decode($json);
 
     // Test whether the two real world cases are handled correctly.
     $settings_two['moduleName']['thingiesOnPage']['id1'] = array();
diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/EmailTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/EmailTest.php
index 3ed7c05..dd80f29 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Form/EmailTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Form/EmailTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Form;
 
+use Drupal\Component\Utility\Json;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -44,14 +45,14 @@ function testFormEmail() {
 
     $edit = array();
     $edit['email_required'] = '  foo.bar@example.com ';
-    $values = drupal_json_decode($this->drupalPostForm('form-test/email', $edit, 'Submit'));
+    $values = Json::decode($this->drupalPostForm('form-test/email', $edit, 'Submit'));
     $this->assertIdentical($values['email'], '');
     $this->assertEqual($values['email_required'], 'foo.bar@example.com');
 
     $edit = array();
     $edit['email'] = 'foo@example.com';
     $edit['email_required'] = 'example@drupal.org';
-    $values = drupal_json_decode($this->drupalPostForm('form-test/email', $edit, 'Submit'));
+    $values = Json::decode($this->drupalPostForm('form-test/email', $edit, 'Submit'));
     $this->assertEqual($values['email'], 'foo@example.com');
     $this->assertEqual($values['email_required'], 'example@drupal.org');
   }
diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/FormTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/FormTest.php
index 6563339..eb60411 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Form/FormTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Form/FormTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Form;
 
+use Drupal\Component\Utility\Json;
 use Drupal\simpletest\WebTestBase;
 
 class FormTest extends WebTestBase {
@@ -272,7 +273,7 @@ function testCheckboxProcessing() {
     $this->assertRaw(t('!name field is required.', array('!name' => 'required_checkbox')), 'A required checkbox is actually mandatory');
 
     // Now try to submit the form correctly.
-    $values = drupal_json_decode($this->drupalPostForm(NULL, array('required_checkbox' => 1), t('Submit')));
+    $values = Json::decode($this->drupalPostForm(NULL, array('required_checkbox' => 1), t('Submit')));
     $expected_values = array(
       'disabled_checkbox_on' => 'disabled_checkbox_on',
       'disabled_checkbox_off' => '',
@@ -326,7 +327,7 @@ function testSelect() {
       'multiple_no_default_required[]' => 'three',
     );
     $this->drupalPostForm(NULL, $edit, 'Submit');
-    $values = drupal_json_decode($this->drupalGetContent());
+    $values = Json::decode($this->drupalGetContent());
 
     // Verify expected values.
     $expected = array(
@@ -506,7 +507,7 @@ function testDisabledElements() {
     // Submit the form with no input, as the browser does for disabled elements,
     // and fetch the $form_state['values'] that is passed to the submit handler.
     $this->drupalPostForm('form-test/disabled-elements', array(), t('Submit'));
-    $returned_values['normal'] = drupal_json_decode($this->content);
+    $returned_values['normal'] = Json::decode($this->content);
 
     // Do the same with input, as could happen if JavaScript un-disables an
     // element. drupalPostForm() emulates a browser by not submitting input for
@@ -523,7 +524,7 @@ function testDisabledElements() {
     $this->assertEqual(count($disabled_elements), 39, 'The correct elements have the disabled property in the HTML code.');
 
     $this->drupalPostForm(NULL, $edit, t('Submit'));
-    $returned_values['hijacked'] = drupal_json_decode($this->content);
+    $returned_values['hijacked'] = Json::decode($this->content);
 
     // Ensure that the returned values match the form's default values in both
     // cases.
diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/LanguageSelectElementTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/LanguageSelectElementTest.php
index dcb700b..19c918f 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Form/LanguageSelectElementTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Form/LanguageSelectElementTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\system\Tests\Form;
 
 use Drupal\simpletest\WebTestBase;
+use Drupal\Component\Utility\Json;
 use Drupal\Core\Language\Language;
 
 /**
@@ -87,7 +88,7 @@ function testHiddenLanguageSelectElement() {
     // field elements.
     $edit = array();
     $this->drupalPostForm(NULL, $edit, t('Submit'));
-    $values = drupal_json_decode($this->drupalGetContent());
+    $values = Json::decode($this->drupalGetContent());
     $this->assertEqual($values['languages_all'], 'xx');
     $this->assertEqual($values['languages_configurable'], 'en');
     $this->assertEqual($values['languages_locked'], Language::LANGCODE_NOT_SPECIFIED);
diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/StateValuesCleanTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/StateValuesCleanTest.php
index b7ae222..e6f844f 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Form/StateValuesCleanTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Form/StateValuesCleanTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Form;
 
+use Drupal\Component\Utility\Json;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -33,7 +34,7 @@ public static function getInfo() {
    * Tests form_state_values_clean().
    */
   function testFormStateValuesClean() {
-    $values = drupal_json_decode($this->drupalPostForm('form_test/form-state-values-clean', array(), t('Submit')));
+    $values = Json::decode($this->drupalPostForm('form_test/form-state-values-clean', array(), t('Submit')));
 
     // Setup the expected result.
     $result = array(
diff --git a/core/modules/system/lib/Drupal/system/Tests/Form/UrlTest.php b/core/modules/system/lib/Drupal/system/Tests/Form/UrlTest.php
index ccfb52e..a068adc 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Form/UrlTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Form/UrlTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Form;
 
+use Drupal\Component\Utility\Json;
 use Drupal\simpletest\WebTestBase;
 
 /**
@@ -45,14 +46,14 @@ function testFormUrl() {
     $edit = array();
     $edit['url'] = "\n";
     $edit['url_required'] = 'http://example.com/   ';
-    $values = drupal_json_decode($this->drupalPostForm('form-test/url', $edit, 'Submit'));
+    $values = Json::decode($this->drupalPostForm('form-test/url', $edit, 'Submit'));
     $this->assertIdentical($values['url'], '');
     $this->assertEqual($values['url_required'], 'http://example.com/');
 
     $edit = array();
     $edit['url'] = 'http://foo.bar.example.com/';
     $edit['url_required'] = 'http://drupal.org/node/1174630?page=0&foo=bar#new';
-    $values = drupal_json_decode($this->drupalPostForm('form-test/url', $edit, 'Submit'));
+    $values = Json::decode($this->drupalPostForm('form-test/url', $edit, 'Submit'));
     $this->assertEqual($values['url'], $edit['url']);
     $this->assertEqual($values['url_required'], $edit['url_required']);
   }
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php
index 5aec19f..92fd6a3 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\taxonomy\Tests;
 
 use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Component\Utility\Json;
 
 /**
  * Tests for taxonomy term functions.
@@ -260,7 +261,7 @@ function testTermAutocompletion() {
     $path = 'taxonomy/autocomplete/node/taxonomy_' . $this->vocabulary->id();
     // The result order is not guaranteed, so check each term separately.
     $result = $this->drupalGet($path, array('query' => array('q' => $input)));
-    $data = drupal_json_decode($result);
+    $data = Json::decode($result);
     $this->assertEqual($data[0]['label'], check_plain($first_term->label()), 'Autocomplete returned the first matching term');
     $this->assertEqual($data[1]['label'], check_plain($second_term->label()), 'Autocomplete returned the second matching term');
 
diff --git a/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayTest.php b/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayTest.php
index b1290c3..39beec6 100644
--- a/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayTest.php
+++ b/core/modules/views_ui/lib/Drupal/views_ui/Tests/DisplayTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views_ui\Tests;
 
+use Drupal\Component\Utility\Json;
 use Drupal\Component\Utility\String;
 
 use Drupal\views\Views;
@@ -303,8 +304,8 @@ public function testPageContextualLinks() {
     $post = array('ids[0]' => $id);
     $response = $this->drupalPost('contextual/render', 'application/json', $post, array('query' => array('destination' => 'test-display')));
     $this->assertResponse(200);
-    $json = drupal_json_decode($response);
-    $this->assertIdentical($json[$id], '<ul class="contextual-links"><li class="views-uiedit odd first last"><a href="' . base_path() . 'admin/structure/views/view/test_display/edit/page_1?destination=test-display">Edit view</a></li></ul>');
+    $json = Json::decode($response);
+    $this->assertIdentical($json[$id], '<ul class="contextual-links"><li class="views-ui-edit odd first last"><a href="' . base_path() . 'admin/structure/views/view/test_display/edit/page_1?destination=test-display">Edit view</a></li></ul>');
   }
 
   /**
