diff --git a/core/modules/aggregator/src/Tests/AggregatorTestBase.php b/core/modules/aggregator/src/Tests/AggregatorTestBase.php
index 616e1e2..cf845db 100644
--- a/core/modules/aggregator/src/Tests/AggregatorTestBase.php
+++ b/core/modules/aggregator/src/Tests/AggregatorTestBase.php
@@ -136,7 +136,7 @@ function getFeedEditObject($feed_url = NULL, array $values = array()) {
    */
   function getDefaultFeedItemCount() {
     // Our tests are based off of rss.xml, so let's find out how many elements should be related.
-    $feed_count = db_query_range('SELECT COUNT(DISTINCT nid) FROM {node_field_data} n WHERE n.promote = 1 AND n.status = 1', 0, $this->container->get('config.factory')->get('system.rss')->get('items.limit'))->fetchField();
+    $feed_count = db_query_range('SELECT COUNT(DISTINCT nid) FROM {node_field_data} n WHERE n.promote = 1 AND n.status = 1', 0, $this->config('system.rss')->get('items.limit'))->fetchField();
     return $feed_count > 10 ? 10 : $feed_count;
   }
 
@@ -336,7 +336,7 @@ function createSampleNodes($count = 5) {
    * Enable the plugins coming with aggregator_test module.
    */
   function enableTestPlugins() {
-    $this->container->get('config.factory')->get('aggregator.settings')
+    $this->config('aggregator.settings')
       ->set('fetcher', 'aggregator_test_fetcher')
       ->set('parser', 'aggregator_test_parser')
       ->set('processors', array(
diff --git a/core/modules/aggregator/src/Tests/FeedParserTest.php b/core/modules/aggregator/src/Tests/FeedParserTest.php
index a6d44c7..ab6aaaf 100644
--- a/core/modules/aggregator/src/Tests/FeedParserTest.php
+++ b/core/modules/aggregator/src/Tests/FeedParserTest.php
@@ -20,7 +20,7 @@ protected function setUp() {
     // Do not delete old aggregator items during these tests, since our sample
     // feeds have hardcoded dates in them (which may be expired when this test
     // is run).
-    $this->container->get('config.factory')->get('aggregator.settings')->set('items.expire', AGGREGATOR_CLEAR_NEVER)->save();
+    $this->config('aggregator.settings')->set('items.expire', AGGREGATOR_CLEAR_NEVER)->save();
     // Reset any reader cache between tests.
     Reader::reset();
     // Set our bridge extension manager to Zend Feed.
diff --git a/core/modules/basic_auth/src/Tests/Authentication/BasicAuthTest.php b/core/modules/basic_auth/src/Tests/Authentication/BasicAuthTest.php
index 3917a16..9c5375a 100644
--- a/core/modules/basic_auth/src/Tests/Authentication/BasicAuthTest.php
+++ b/core/modules/basic_auth/src/Tests/Authentication/BasicAuthTest.php
@@ -58,7 +58,7 @@ public function testBasicAuth() {
    * Test the global login flood control.
    */
   function testGlobalLoginFloodControl() {
-    \Drupal::config('user.flood')
+    $this->config('user.flood')
       ->set('ip_limit', 2)
       // Set a high per-user limit out so that it is not relevant in the test.
       ->set('user_limit', 4000)
@@ -82,7 +82,7 @@ function testGlobalLoginFloodControl() {
    * Test the per-user login flood control.
    */
   function testPerUserLoginFloodControl() {
-    \Drupal::config('user.flood')
+    $this->config('user.flood')
       // Set a high global limit out so that it is not relevant in the test.
       ->set('ip_limit', 4000)
       ->set('user_limit', 2)
@@ -120,7 +120,7 @@ function testPerUserLoginFloodControl() {
    */
   function testLocale() {
     ConfigurableLanguage::createFromLangcode('de')->save();
-    \Drupal::config('system.site')->set('langcode', 'de')->save();
+    $this->config('system.site')->set('langcode', 'de')->save();
 
     $account = $this->drupalCreateUser();
 
diff --git a/core/modules/block/src/Tests/BlockConfigSchemaTest.php b/core/modules/block/src/Tests/BlockConfigSchemaTest.php
index c12fb65..9d7bcfe 100644
--- a/core/modules/block/src/Tests/BlockConfigSchemaTest.php
+++ b/core/modules/block/src/Tests/BlockConfigSchemaTest.php
@@ -89,7 +89,7 @@ public function testBlockConfigSchema() {
       ));
       $block->save();
 
-      $config = \Drupal::config("block.block.$id");
+      $config = $this->config("block.block.$id");
       $this->assertEqual($config->get('id'), $id);
       $this->assertConfigSchema($this->typedConfig, $config->getName(), $config->get());
     }
diff --git a/core/modules/block/src/Tests/BlockHiddenRegionTest.php b/core/modules/block/src/Tests/BlockHiddenRegionTest.php
index f451103..b5abe7c 100644
--- a/core/modules/block/src/Tests/BlockHiddenRegionTest.php
+++ b/core/modules/block/src/Tests/BlockHiddenRegionTest.php
@@ -56,7 +56,7 @@ public function testBlockNotInHiddenRegion() {
     // Install "block_test_theme" and set it as the default theme.
     $theme = 'block_test_theme';
     \Drupal::service('theme_handler')->install(array($theme));
-    \Drupal::config('system.theme')
+    $this->config('system.theme')
       ->set('default', $theme)
       ->save();
     // Installing a theme will cause the kernel terminate event to rebuild the
diff --git a/core/modules/block/src/Tests/BlockLanguageTest.php b/core/modules/block/src/Tests/BlockLanguageTest.php
index 958a08e..df5e693 100644
--- a/core/modules/block/src/Tests/BlockLanguageTest.php
+++ b/core/modules/block/src/Tests/BlockLanguageTest.php
@@ -50,7 +50,7 @@ protected function setUp() {
    */
   public function testLanguageBlockVisibility() {
     // Check if the visibility setting is available.
-    $default_theme = \Drupal::config('system.theme')->get('default');
+    $default_theme = $this->config('system.theme')->get('default');
     $this->drupalGet('admin/structure/block/add/system_powered_by_block' . '/' . $default_theme);
 
     $this->assertField('visibility[language][langcodes][en]', 'Language visibility field is visible.');
@@ -128,7 +128,7 @@ public function testMultipleLanguageTypes() {
     $this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings'));
 
     // Check if the visibility setting is available with a type setting.
-    $default_theme = \Drupal::config('system.theme')->get('default');
+    $default_theme = $this->config('system.theme')->get('default');
     $this->drupalGet('admin/structure/block/add/system_powered_by_block' . '/' . $default_theme);
     $this->assertField('visibility[language][langcodes][en]', 'Language visibility field is visible.');
     $this->assertField('visibility[language][context_mapping][language]', 'Language type field is visible.');
diff --git a/core/modules/block/src/Tests/BlockStorageUnitTest.php b/core/modules/block/src/Tests/BlockStorageUnitTest.php
index b550bcc..86f7d2f 100644
--- a/core/modules/block/src/Tests/BlockStorageUnitTest.php
+++ b/core/modules/block/src/Tests/BlockStorageUnitTest.php
@@ -78,7 +78,7 @@ protected function createTests() {
     $this->assertTrue($entity instanceof Block, 'The newly created entity is a Block.');
 
     // Verify all of the block properties.
-    $actual_properties = \Drupal::config('block.block.test_block')->get();
+    $actual_properties = $this->config('block.block.test_block')->get();
     $this->assertTrue(!empty($actual_properties['uuid']), 'The block UUID is set.');
     unset($actual_properties['uuid']);
 
diff --git a/core/modules/block/src/Tests/BlockSystemBrandingTest.php b/core/modules/block/src/Tests/BlockSystemBrandingTest.php
index 7bf81e1..82cff41 100644
--- a/core/modules/block/src/Tests/BlockSystemBrandingTest.php
+++ b/core/modules/block/src/Tests/BlockSystemBrandingTest.php
@@ -27,7 +27,7 @@ class BlockSystemBrandingTest extends BlockTestBase {
   protected function setUp() {
     parent::setUp();
     // Set a site slogan.
-    \Drupal::config('system.site')
+    $this->config('system.site')
       ->set('slogan', 'Community plumbing')
       ->save();
     // Add the system branding block to the page.
@@ -53,7 +53,7 @@ public function testSystemBrandingSettings() {
     $this->assertTrue(!empty($site_slogan_element), 'The branding block slogan was found.');
 
     // Turn just the logo off.
-    \Drupal::config('block.block.site-branding')
+    $this->config('block.block.site-branding')
       ->set('settings.use_site_logo', 0)
       ->save();
     $this->drupalGet('');
@@ -66,7 +66,7 @@ public function testSystemBrandingSettings() {
     $this->assertTrue(!empty($site_slogan_element), 'The branding block slogan was found.');
 
     // Turn just the site name off.
-    \Drupal::config('block.block.site-branding')
+    $this->config('block.block.site-branding')
       ->set('settings.use_site_logo', 1)
       ->set('settings.use_site_name', 0)
       ->save();
@@ -80,7 +80,7 @@ public function testSystemBrandingSettings() {
     $this->assertTrue(!empty($site_slogan_element), 'The branding block slogan was found.');
 
     // Turn just the site slogan off.
-    \Drupal::config('block.block.site-branding')
+    $this->config('block.block.site-branding')
       ->set('settings.use_site_name', 1)
       ->set('settings.use_site_slogan', 0)
       ->save();
@@ -94,7 +94,7 @@ public function testSystemBrandingSettings() {
     $this->assertTrue(empty($site_slogan_element), 'The branding block slogan was disabled.');
 
     // Turn the site name and the site slogan off.
-    \Drupal::config('block.block.site-branding')
+    $this->config('block.block.site-branding')
       ->set('settings.use_site_name', 0)
       ->set('settings.use_site_slogan', 0)
       ->save();
diff --git a/core/modules/block/src/Tests/BlockTest.php b/core/modules/block/src/Tests/BlockTest.php
index 809f289..9c30e10 100644
--- a/core/modules/block/src/Tests/BlockTest.php
+++ b/core/modules/block/src/Tests/BlockTest.php
@@ -28,7 +28,7 @@ function testBlockVisibility() {
     // Create a random title for the block.
     $title = $this->randomMachineName(8);
     // Enable a standard block.
-    $default_theme = \Drupal::config('system.theme')->get('default');
+    $default_theme = $this->config('system.theme')->get('default');
     $edit = array(
       'id' => strtolower($this->randomMachineName(8)),
       'region' => 'sidebar_first',
@@ -66,7 +66,7 @@ public function testBlockToggleVisibility() {
     // Create a random title for the block.
     $title = $this->randomMachineName(8);
     // Enable a standard block.
-    $default_theme = \Drupal::config('system.theme')->get('default');
+    $default_theme = $this->config('system.theme')->get('default');
     $edit = array(
       'id' => strtolower($this->randomMachineName(8)),
       'region' => 'sidebar_first',
@@ -102,7 +102,7 @@ function testBlockVisibilityListedEmpty() {
     // Create a random title for the block.
     $title = $this->randomMachineName(8);
     // Enable a standard block.
-    $default_theme = \Drupal::config('system.theme')->get('default');
+    $default_theme = $this->config('system.theme')->get('default');
     $edit = array(
       'id' => strtolower($this->randomMachineName(8)),
       'region' => 'sidebar_first',
@@ -134,7 +134,7 @@ function testBlock() {
     $block = array();
     $block['id'] = 'system_powered_by_block';
     $block['settings[label]'] = $this->randomMachineName(8);
-    $block['theme'] = \Drupal::config('system.theme')->get('default');
+    $block['theme'] = $this->config('system.theme')->get('default');
     $block['region'] = 'header';
 
     // Set block title to confirm that interface works and override any custom titles.
@@ -190,7 +190,7 @@ function testBlock() {
   public function testBlockThemeSelector() {
     // Install all themes.
     \Drupal::service('theme_handler')->install(array('bartik', 'seven'));
-    $theme_settings = $this->container->get('config.factory')->get('system.theme');
+    $theme_settings = $this->config('system.theme');
     foreach (array('bartik', 'classy', 'seven') as $theme) {
       $this->drupalGet('admin/structure/block/list/' . $theme);
       $this->assertTitle(t('Block layout') . ' | Drupal');
@@ -236,7 +236,7 @@ function testHideBlockTitle() {
     $title = $this->randomMachineName(8);
     $id = strtolower($this->randomMachineName(8));
     // Enable a standard block.
-    $default_theme = \Drupal::config('system.theme')->get('default');
+    $default_theme = $this->config('system.theme')->get('default');
     $edit = array(
       'id' => $id,
       'region' => 'sidebar_first',
@@ -275,7 +275,7 @@ function testHideBlockTitle() {
    */
   function moveBlockToRegion(array $block, $region) {
     // Set the created block to a specific region.
-    $block += array('theme' => \Drupal::config('system.theme')->get('default'));
+    $block += array('theme' => $this->config('system.theme')->get('default'));
     $edit = array();
     $edit['blocks[' . $block['id'] . '][region]'] = $region;
     $this->drupalPostForm('admin/structure/block', $edit, t('Save blocks'));
@@ -307,7 +307,7 @@ public function testBlockCacheTags() {
     $this->drupalLogout();
 
     // Enable page caching.
-    $config = \Drupal::config('system.performance');
+    $config = $this->config('system.performance');
     $config->set('cache.page.use_internal', 1);
     $config->set('cache.page.max_age', 300);
     $config->save();
diff --git a/core/modules/block/src/Tests/BlockTestBase.php b/core/modules/block/src/Tests/BlockTestBase.php
index bea4040..0aabffa 100644
--- a/core/modules/block/src/Tests/BlockTestBase.php
+++ b/core/modules/block/src/Tests/BlockTestBase.php
@@ -39,7 +39,7 @@ protected function setUp() {
     parent::setUp();
 
     // Use the test page as the front page.
-    \Drupal::config('system.site')->set('page.front', 'test-page')->save();
+    $this->config('system.site')->set('page.front', 'test-page')->save();
 
     // Create Full HTML text format.
     $full_html_format = entity_create('filter_format', array(
@@ -66,7 +66,7 @@ protected function setUp() {
       'footer',
     );
     $block_storage = $this->container->get('entity.manager')->getStorage('block');
-    $blocks = $block_storage->loadByProperties(array('theme' => \Drupal::config('system.theme')->get('default')));
+    $blocks = $block_storage->loadByProperties(array('theme' => $this->config('system.theme')->get('default')));
     foreach ($blocks as $block) {
       $block->delete();
     }
diff --git a/core/modules/block/src/Tests/BlockTitleXSSTest.php b/core/modules/block/src/Tests/BlockTitleXSSTest.php
index 5305df6..3790d56 100644
--- a/core/modules/block/src/Tests/BlockTitleXSSTest.php
+++ b/core/modules/block/src/Tests/BlockTitleXSSTest.php
@@ -38,7 +38,7 @@ function testXSSInTitle() {
     $this->assertNoRaw('<script>alert("XSS label");</script>', 'The block title was properly sanitized when rendered.');
 
     $this->drupalLogin($this->drupalCreateUser(array('administer blocks', 'access administration pages')));
-    $default_theme = \Drupal::config('system.theme')->get('default');
+    $default_theme = $this->config('system.theme')->get('default');
     $this->drupalGet('admin/structure/block/list/' . $default_theme);
     $this->assertNoRaw("<script>alert('XSS subject');</script>", 'The block title was properly sanitized in Block Plugin UI Admin page.');
   }
diff --git a/core/modules/block/src/Tests/NewDefaultThemeBlocksTest.php b/core/modules/block/src/Tests/NewDefaultThemeBlocksTest.php
index 9ceab52..42bbf5d 100644
--- a/core/modules/block/src/Tests/NewDefaultThemeBlocksTest.php
+++ b/core/modules/block/src/Tests/NewDefaultThemeBlocksTest.php
@@ -27,7 +27,7 @@ class NewDefaultThemeBlocksTest extends WebTestBase {
    * Check the enabled Bartik blocks are correctly copied over.
    */
   function testNewDefaultThemeBlocks() {
-    $default_theme = \Drupal::config('system.theme')->get('default');
+    $default_theme = $this->config('system.theme')->get('default');
 
     // Add two instances of the user login block.
     $this->drupalPlaceBlock('user_login_block', array(
@@ -46,7 +46,7 @@ function testNewDefaultThemeBlocks() {
     $new_theme = 'bartik';
     $this->assertFalse($new_theme == $default_theme, 'The new theme is different from the previous default theme.');
     \Drupal::service('theme_handler')->install(array($new_theme));
-    \Drupal::config('system.theme')
+    $this->config('system.theme')
       ->set('default', $new_theme)
       ->save();
 
diff --git a/core/modules/block/src/Tests/Views/DisplayBlockTest.php b/core/modules/block/src/Tests/Views/DisplayBlockTest.php
index fe30da5..474b8f1 100644
--- a/core/modules/block/src/Tests/Views/DisplayBlockTest.php
+++ b/core/modules/block/src/Tests/Views/DisplayBlockTest.php
@@ -184,7 +184,7 @@ protected function testDeleteBlockDisplay() {
    */
   public function testViewsBlockForm() {
     $this->drupalLogin($this->drupalCreateUser(array('administer blocks')));
-    $default_theme = \Drupal::config('system.theme')->get('default');
+    $default_theme = $this->config('system.theme')->get('default');
     $this->drupalGet('admin/structure/block/add/views_block:test_view_block-block_1/' . $default_theme);
     $elements = $this->xpath('//input[@name="label"]');
     $this->assertTrue(empty($elements), 'The label field is not found for Views blocks.');
diff --git a/core/modules/block_content/src/Tests/BlockContentCreationTest.php b/core/modules/block_content/src/Tests/BlockContentCreationTest.php
index a93b756..7797571 100644
--- a/core/modules/block_content/src/Tests/BlockContentCreationTest.php
+++ b/core/modules/block_content/src/Tests/BlockContentCreationTest.php
@@ -170,7 +170,7 @@ public function testBlockDelete() {
       'region' => 'sidebar_first',
     );
     $block = entity_load('block_content', 1);
-    $url = 'admin/structure/block/add/block_content:' . $block->uuid() . '/' . \Drupal::config('system.theme')->get('default');
+    $url = 'admin/structure/block/add/block_content:' . $block->uuid() . '/' . $this->config('system.theme')->get('default');
     $this->drupalPostForm($url, $instance, t('Save block'));
 
     $block = BlockContent::load(1);
@@ -224,7 +224,7 @@ public function testConfigDependencies() {
       'region' => 'sidebar_first',
     );
     $block = entity_load('block_content', 1);
-    $url = 'admin/structure/block/add/block_content:' . $block->uuid() . '/' . \Drupal::config('system.theme')->get('default');
+    $url = 'admin/structure/block/add/block_content:' . $block->uuid() . '/' . $this->config('system.theme')->get('default');
     $this->drupalPostForm($url, $instance, t('Save block'));
 
     $dependencies = \Drupal::service('config.manager')->findConfigEntityDependentsAsEntities('content', array($block->getConfigDependencyName()));
diff --git a/core/modules/block_content/src/Tests/BlockContentFieldTest.php b/core/modules/block_content/src/Tests/BlockContentFieldTest.php
index 4fc7bf6..7067a59 100644
--- a/core/modules/block_content/src/Tests/BlockContentFieldTest.php
+++ b/core/modules/block_content/src/Tests/BlockContentFieldTest.php
@@ -91,7 +91,7 @@ public function testBlockFields() {
     );
     $this->drupalPostForm(NULL, $edit, t('Save'));
     $block = entity_load('block_content', 1);
-    $url = 'admin/structure/block/add/block_content:' . $block->uuid() . '/' . \Drupal::config('system.theme')->get('default');
+    $url = 'admin/structure/block/add/block_content:' . $block->uuid() . '/' . $this->config('system.theme')->get('default');
     // Place the block.
     $instance = array(
       'id' => Unicode::strtolower($edit['info[0][value]']),
diff --git a/core/modules/block_content/src/Tests/BlockContentTypeTest.php b/core/modules/block_content/src/Tests/BlockContentTypeTest.php
index 632c12a..60f1210 100644
--- a/core/modules/block_content/src/Tests/BlockContentTypeTest.php
+++ b/core/modules/block_content/src/Tests/BlockContentTypeTest.php
@@ -149,7 +149,7 @@ public function testsBlockContentAddTypes() {
     // Install all themes.
     \Drupal::service('theme_handler')->install(array('bartik', 'seven'));
     $themes = array('bartik', 'seven', 'classy');
-    $theme_settings = $this->container->get('config.factory')->get('system.theme');
+    $theme_settings = $this->config('system.theme');
     foreach ($themes as $default_theme) {
       // Change the default theme.
       $theme_settings->set('default', $default_theme)->save();
diff --git a/core/modules/book/src/Tests/BookTest.php b/core/modules/book/src/Tests/BookTest.php
index 44c71ec..0064a66 100644
--- a/core/modules/book/src/Tests/BookTest.php
+++ b/core/modules/book/src/Tests/BookTest.php
@@ -481,9 +481,9 @@ function testBookNodeTypeChange() {
     //   'page',
     // );
     // @endcode
-    $current_config = \Drupal::config('book.settings')->get();
+    $current_config = $this->config('book.settings')->get();
     $this->drupalPostForm('admin/structure/book/settings', array(), t('Save configuration'));
-    $this->assertIdentical($current_config, \Drupal::config('book.settings')->get());
+    $this->assertIdentical($current_config, $this->config('book.settings')->get());
 
     // Change the name, machine name and description.
     $edit = array(
@@ -502,9 +502,9 @@ function testBookNodeTypeChange() {
     //   'zebra',
     // );
     // @endcode
-    $current_config = \Drupal::config('book.settings')->get();
+    $current_config = $this->config('book.settings')->get();
     $this->drupalPostForm('admin/structure/book/settings', array(), t('Save configuration'));
-    $this->assertIdentical($current_config, \Drupal::config('book.settings')->get());
+    $this->assertIdentical($current_config, $this->config('book.settings')->get());
 
     $edit = array(
       'name' => 'Animal book',
@@ -520,13 +520,13 @@ function testBookNodeTypeChange() {
     //   'zebra',
     // );
     // @endcode
-    $current_config = \Drupal::config('book.settings')->get();
+    $current_config = $this->config('book.settings')->get();
     $this->drupalPostForm('admin/structure/book/settings', array(), t('Save configuration'));
-    $this->assertIdentical($current_config, \Drupal::config('book.settings')->get());
+    $this->assertIdentical($current_config, $this->config('book.settings')->get());
 
     // Ensure that after all the node type changes book.settings:child_type has
     // the expected value.
-    $this->assertEqual(\Drupal::config('book.settings')->get('child_type'), 'zebra');
+    $this->assertEqual($this->config('book.settings')->get('child_type'), 'zebra');
   }
 
   /**
diff --git a/core/modules/book/src/Tests/BookUninstallTest.php b/core/modules/book/src/Tests/BookUninstallTest.php
index a1d55f7..317a16a 100644
--- a/core/modules/book/src/Tests/BookUninstallTest.php
+++ b/core/modules/book/src/Tests/BookUninstallTest.php
@@ -52,7 +52,7 @@ public function testBookUninstall() {
       'name' => $this->randomString(),
     ));
     $content_type->save();
-    $book_config = \Drupal::config('book.settings');
+    $book_config = $this->config('book.settings');
     $allowed_types = $book_config->get('allowed_types');
     $allowed_types[] = $content_type->id();
     $book_config->set('allowed_types', $allowed_types)->save();
diff --git a/core/modules/ckeditor/src/Tests/CKEditorTest.php b/core/modules/ckeditor/src/Tests/CKEditorTest.php
index 9133ee0..e81caf2 100644
--- a/core/modules/ckeditor/src/Tests/CKEditorTest.php
+++ b/core/modules/ckeditor/src/Tests/CKEditorTest.php
@@ -264,7 +264,7 @@ function testBuildContentsCssJSSetting() {
 
     // Enable the Bartik theme, which specifies a CKEditor stylesheet.
     \Drupal::service('theme_handler')->install(['bartik']);
-    \Drupal::config('system.theme')->set('default', 'bartik');
+    $this->config('system.theme')->set('default', 'bartik')->save();
     $expected[] = file_create_url('core/themes/bartik/css/ckeditor-iframe.css');
     $this->assertIdentical($expected, $this->ckeditor->buildContentsCssJSSetting($editor), '"contentsCss" configuration part of JS settings built correctly while a theme providing a CKEditor stylesheet exists.');
   }
diff --git a/core/modules/color/src/Tests/ColorTest.php b/core/modules/color/src/Tests/ColorTest.php
index 185faae..3456dca 100644
--- a/core/modules/color/src/Tests/ColorTest.php
+++ b/core/modules/color/src/Tests/ColorTest.php
@@ -105,7 +105,7 @@ function testColor() {
    *   color', 'Color set', etc) for the theme which being tested.
    */
   function _testColor($theme, $test_values) {
-    \Drupal::config('system.theme')
+    $this->config('system.theme')
       ->set('default', $theme)
       ->save();
     $settings_path = 'admin/appearance/settings/' . $theme;
@@ -119,7 +119,7 @@ function _testColor($theme, $test_values) {
     $this->drupalPostForm($settings_path, $edit, t('Save configuration'));
 
     $this->drupalGet('<front>');
-    $stylesheets = \Drupal::config('color.theme.' . $theme)->get('stylesheets');
+    $stylesheets = $this->config('color.theme.' . $theme)->get('stylesheets');
     foreach ($stylesheets as $stylesheet) {
       $this->assertPattern('|' . file_create_url($stylesheet) . '|', 'Make sure the color stylesheet is included in the content. (' . $theme . ')');
       $stylesheet_content = join("\n", file($stylesheet));
@@ -132,14 +132,14 @@ function _testColor($theme, $test_values) {
     $this->drupalPostForm($settings_path, $edit, t('Save configuration'));
 
     $this->drupalGet('<front>');
-    $stylesheets = \Drupal::config('color.theme.' . $theme)->get('stylesheets');
+    $stylesheets = $this->config('color.theme.' . $theme)->get('stylesheets');
     foreach ($stylesheets as $stylesheet) {
       $stylesheet_content = join("\n", file($stylesheet));
       $this->assertTrue(strpos($stylesheet_content, 'color: ' . $test_values['scheme_color']) !== FALSE, 'Make sure the color we changed is in the color stylesheet. (' . $theme . ')');
     }
 
     // Test with aggregated CSS turned on.
-    $config = \Drupal::config('system.performance');
+    $config = $this->config('system.performance');
     $config->set('css.preprocess', 1);
     $config->save();
     $this->drupalGet('<front>');
@@ -157,7 +157,7 @@ function _testColor($theme, $test_values) {
    * Tests whether the provided color is valid.
    */
   function testValidColor() {
-    \Drupal::config('system.theme')
+    $this->config('system.theme')
       ->set('default', 'bartik')
       ->save();
     $settings_path = 'admin/appearance/settings/bartik';
diff --git a/core/modules/comment/src/Tests/CommentLinksTest.php b/core/modules/comment/src/Tests/CommentLinksTest.php
index 0fbfa77..35b1ffc 100644
--- a/core/modules/comment/src/Tests/CommentLinksTest.php
+++ b/core/modules/comment/src/Tests/CommentLinksTest.php
@@ -48,7 +48,7 @@ class CommentLinksTest extends CommentTestBase {
   public function testCommentLinks() {
     // Bartik theme alters comment links, so use a different theme.
     \Drupal::service('theme_handler')->install(array('stark'));
-    \Drupal::config('system.theme')
+    $this->config('system.theme')
       ->set('default', 'stark')
       ->save();
 
diff --git a/core/modules/comment/src/Tests/CommentPreviewTest.php b/core/modules/comment/src/Tests/CommentPreviewTest.php
index 23620a5..ae65f88 100644
--- a/core/modules/comment/src/Tests/CommentPreviewTest.php
+++ b/core/modules/comment/src/Tests/CommentPreviewTest.php
@@ -41,7 +41,7 @@ function testCommentPreview() {
 
     // Login as web user and add a signature and a user picture.
     $this->drupalLogin($this->webUser);
-    \Drupal::config('user.settings')->set('signatures', 1)->save();
+    $this->config('user.settings')->set('signatures', 1)->save();
     $test_signature = $this->randomMachineName();
     $edit['signature[value]'] = '<a href="http://example.com/">' . $test_signature. '</a>';
     $image = current($this->drupalGetTestFiles('image'));
diff --git a/core/modules/config/src/Tests/ConfigCRUDTest.php b/core/modules/config/src/Tests/ConfigCRUDTest.php
index bf65570..25391fe 100644
--- a/core/modules/config/src/Tests/ConfigCRUDTest.php
+++ b/core/modules/config/src/Tests/ConfigCRUDTest.php
@@ -44,9 +44,10 @@ class ConfigCRUDTest extends KernelTestBase {
    */
   function testCRUD() {
     $storage = $this->container->get('config.storage');
+    $config_factory = $this->container->get('config.factory');
     $name = 'config_test.crud';
 
-    $config = \Drupal::config($name);
+    $config = $this->config($name);
     $this->assertIdentical($config->isNew(), TRUE);
 
     // Create a new configuration object.
@@ -67,15 +68,15 @@ function testCRUD() {
     $actual_data = $storage->read($name);
     $this->assertIdentical($actual_data, array('value' => 'instance-update'));
 
-    // Verify a call to \Drupal::config() immediately returns the updated value.
-    $new_config = \Drupal::config($name);
+    // Verify a call to $this->config() immediately returns the updated value.
+    $new_config = $this->config($name);
     $this->assertIdentical($new_config->get(), $config->get());
     $this->assertIdentical($config->isNew(), FALSE);
 
     // Pollute the config factory static cache.
-    $this->container->get('config.factory')->setOverrideState(FALSE);
-    \Drupal::config($name);
-    $this->container->get('config.factory')->setOverrideState(TRUE);
+    $config_factory->setOverrideState(FALSE);
+    $config_factory->get($name);
+    $config_factory->setOverrideState(TRUE);
 
     // Delete the configuration object.
     $config->delete();
@@ -86,16 +87,16 @@ function testCRUD() {
 
     // Verify that all copies of the configuration has been removed from the
     // static cache.
-    $this->container->get('config.factory')->setOverrideState(FALSE);
-    $this->assertIdentical(\Drupal::config($name)->isNew(), TRUE);
-    $this->container->get('config.factory')->setOverrideState(TRUE);
+    $config_factory->setOverrideState(FALSE);
+    $this->assertIdentical($config_factory->get($name)->isNew(), TRUE);
+    $config_factory->setOverrideState(TRUE);
 
     // Verify the active configuration contains no value.
     $actual_data = $storage->read($name);
     $this->assertIdentical($actual_data, FALSE);
 
-    // Verify \Drupal::config() returns no data.
-    $new_config = \Drupal::config($name);
+    // Verify $this->config() returns no data.
+    $new_config = $this->config($name);
     $this->assertIdentical($new_config->get(), $config->get());
     $this->assertIdentical($config->isNew(), TRUE);
 
@@ -108,49 +109,48 @@ function testCRUD() {
     $actual_data = $storage->read($name);
     $this->assertIdentical($actual_data, array('value' => 're-created'));
 
-    // Verify a call to \Drupal::config() immediately returns the updated value.
-    $new_config = \Drupal::config($name);
+    // Verify a call to $this->config() immediately returns the updated value.
+    $new_config = $this->config($name);
     $this->assertIdentical($new_config->get(), $config->get());
     $this->assertIdentical($config->isNew(), FALSE);
 
     // Rename the configuration object.
     $new_name = 'config_test.crud_rename';
     $this->container->get('config.factory')->rename($name, $new_name);
-    $renamed_config = \Drupal::config($new_name);
+    $renamed_config = $this->config($new_name);
     $this->assertIdentical($renamed_config->get(), $config->get());
     $this->assertIdentical($renamed_config->isNew(), FALSE);
 
     // Ensure that the old configuration object is removed from both the cache
     // and the configuration storage.
-    $config = \Drupal::config($name);
+    $config = $this->config($name);
     $this->assertIdentical($config->get(), array());
     $this->assertIdentical($config->isNew(), TRUE);
 
     // Test renaming when config.factory does not have the object in its static
     // cache.
-    $config_factory = $this->container->get('config.factory');
     $name = 'config_test.crud_rename';
     // Turn off overrides and pollute the non-overrides static cache.
     $config_factory->setOverrideState(FALSE);
-    \Drupal::config($name);
+    $config_factory->get($name);
     // Turn on overrides and pollute the overrides static cache.
     $config_factory->setOverrideState(TRUE);
-    $config = \Drupal::config($name);
+    $config = $config_factory->get($name);
     // Rename and ensure that happened properly.
     $new_name = 'config_test.crud_rename_no_cache';
     $config_factory->rename($name, $new_name);
-    $renamed_config = \Drupal::config($new_name);
+    $renamed_config = $config_factory->get($new_name);
     $this->assertIdentical($renamed_config->get(), $config->get());
     $this->assertIdentical($renamed_config->isNew(), FALSE);
     // Ensure the overrides static cache has been cleared.
-    $this->assertIdentical(\Drupal::config($name)->isNew(), TRUE);
+    $this->assertIdentical($config_factory->get($name)->isNew(), TRUE);
     // Ensure the non-overrides static cache has been cleared.
     $config_factory->setOverrideState(FALSE);
-    $this->assertIdentical(\Drupal::config($name)->isNew(), TRUE);
+    $this->assertIdentical($config_factory->get($name)->isNew(), TRUE);
     $config_factory->setOverrideState(TRUE);
 
     // Merge data into the configuration object.
-    $new_config = \Drupal::config($new_name);
+    $new_config = $this->config($new_name);
     $expected_values = array(
       'value' => 'herp',
       '404' => 'derp',
@@ -169,7 +169,7 @@ function testNameValidation() {
     $name = 'nonamespace';
     $message = 'Expected ConfigNameException was thrown for a name without a namespace.';
     try {
-      \Drupal::config($name)->save();
+      $this->config($name)->save();
       $this->fail($message);
     }
     catch (ConfigNameException $e) {
@@ -180,7 +180,7 @@ function testNameValidation() {
     $name = 'config_test.herman_melville.moby_dick_or_the_whale.harper_1851.now_small_fowls_flew_screaming_over_the_yet_yawning_gulf_a_sullen_white_surf_beat_against_its_steep_sides_then_all_collapsed_and_the_great_shroud_of_the_sea_rolled_on_as_it_rolled_five_thousand_years_ago';
     $message = 'Expected ConfigNameException was thrown for a name longer than Config::MAX_NAME_LENGTH.';
     try {
-      \Drupal::config($name)->save();
+      $this->config($name)->save();
       $this->fail($message);
     }
     catch (ConfigNameException $e) {
@@ -192,7 +192,7 @@ function testNameValidation() {
     foreach ($test_characters as $i => $c) {
       try {
         $name = 'namespace.object' . $c;
-        $config = \Drupal::config($name);
+        $config = $this->config($name);
         $config->save();
       }
       catch (ConfigNameException $e) {
@@ -207,7 +207,7 @@ function testNameValidation() {
     $name = 'namespace.object';
     $message = 'ConfigNameException was not thrown for a valid object name.';
     try {
-      $config = \Drupal::config($name);
+      $config = $this->config($name);
       $config->save();
       $this->pass($message);
     }
@@ -224,7 +224,7 @@ function testValueValidation() {
     // Verify that setData() will catch dotted keys.
     $message = 'Expected ConfigValueException was thrown from setData() for value with dotted keys.';
     try {
-      \Drupal::config('namespace.object')->setData(array('key.value' => 12))->save();
+      $this->config('namespace.object')->setData(array('key.value' => 12))->save();
       $this->fail($message);
     }
     catch (ConfigValueException $e) {
@@ -234,7 +234,7 @@ function testValueValidation() {
     // Verify that set() will catch dotted keys.
     $message = 'Expected ConfigValueException was thrown from set() for value with dotted keys.';
     try {
-      \Drupal::config('namespace.object')->set('foo', array('key.value' => 12))->save();
+      $this->config('namespace.object')->set('foo', array('key.value' => 12))->save();
       $this->fail($message);
     }
     catch (ConfigValueException $e) {
diff --git a/core/modules/config/src/Tests/ConfigDependencyTest.php b/core/modules/config/src/Tests/ConfigDependencyTest.php
index 88abef7..6c7b8ec 100644
--- a/core/modules/config/src/Tests/ConfigDependencyTest.php
+++ b/core/modules/config/src/Tests/ConfigDependencyTest.php
@@ -64,7 +64,7 @@ public function testDependencyMangement() {
     $this->assertFalse(isset($dependents['config_test.dynamic.entity1']), 'config_test.dynamic.entity1 does not have a dependency on the Views module.');
     // Ensure that the provider of the config entity is not actually written to
     // the dependencies array.
-    $raw_config = \Drupal::config('config_test.dynamic.entity1');
+    $raw_config = $this->config('config_test.dynamic.entity1');
     $this->assertTrue(array_search('node', $raw_config->get('dependencies.module')) !== FALSE, 'Node module is written to the dependencies array as this has to be explicit.');
 
     // Create additional entities to test dependencies on config entities.
diff --git a/core/modules/config/src/Tests/ConfigEntityNormalizeTest.php b/core/modules/config/src/Tests/ConfigEntityNormalizeTest.php
index 5e52cfe..b1c6297 100644
--- a/core/modules/config/src/Tests/ConfigEntityNormalizeTest.php
+++ b/core/modules/config/src/Tests/ConfigEntityNormalizeTest.php
@@ -23,7 +23,7 @@ public function testNormalize() {
     $config_entity->save();
 
     // Modify stored config entity, this is comparable with a schema change.
-    $config = \Drupal::config('config_test.dynamic.system');
+    $config = $this->config('config_test.dynamic.system');
     $data = array(
       'label' => 'foobar',
       'additional_key' => TRUE
@@ -34,7 +34,7 @@ public function testNormalize() {
     $config_entity = entity_load('config_test', 'system', TRUE);
     $config_entity->save();
 
-    $config = \Drupal::config('config_test.dynamic.system');
+    $config = $this->config('config_test.dynamic.system');
     $this->assertIdentical($config_entity->toArray(), $config->getRawData(), 'Stored config entity is equivalent to config schema.');
   }
 
diff --git a/core/modules/config/src/Tests/ConfigExportImportUITest.php b/core/modules/config/src/Tests/ConfigExportImportUITest.php
index 0c35736..3139d1d 100644
--- a/core/modules/config/src/Tests/ConfigExportImportUITest.php
+++ b/core/modules/config/src/Tests/ConfigExportImportUITest.php
@@ -53,13 +53,13 @@ protected function setUp() {
    * Tests a simple site export import case.
    */
   public function testExportImport() {
-    $this->originalSlogan = \Drupal::config('system.site')->get('slogan');
+    $this->originalSlogan = $this->config('system.site')->get('slogan');
     $this->newSlogan = $this->randomString(16);
     $this->assertNotEqual($this->newSlogan, $this->originalSlogan);
-    \Drupal::config('system.site')
+    $this->config('system.site')
       ->set('slogan', $this->newSlogan)
       ->save();
-    $this->assertEqual(\Drupal::config('system.site')->get('slogan'), $this->newSlogan);
+    $this->assertEqual($this->config('system.site')->get('slogan'), $this->newSlogan);
 
     // Create a content type.
     $this->content_type = $this->drupalCreateContentType();
@@ -92,10 +92,10 @@ public function testExportImport() {
     $this->drupalPostForm('admin/config/development/configuration/full/export', array(), 'Export');
     $this->tarball = $this->drupalGetContent();
 
-    \Drupal::config('system.site')
+    $this->config('system.site')
       ->set('slogan', $this->originalSlogan)
       ->save();
-    $this->assertEqual(\Drupal::config('system.site')->get('slogan'), $this->originalSlogan);
+    $this->assertEqual($this->config('system.site')->get('slogan'), $this->originalSlogan);
 
     // Delete the custom field.
     $fields = FieldConfig::loadMultiple();
@@ -119,12 +119,12 @@ public function testExportImport() {
     $this->drupalPostForm('admin/config/development/configuration/full/import', array('files[import_tarball]' => $filename), 'Upload');
     $this->drupalPostForm(NULL, array(), 'Import all');
 
-    $this->assertEqual(\Drupal::config('system.site')->get('slogan'), $this->newSlogan);
+    $this->assertEqual($this->config('system.site')->get('slogan'), $this->newSlogan);
 
     $this->drupalGet('node/add');
     $this->assertFieldByName("{$this->fieldName}[0][value]", '', 'Widget is displayed');
 
-    \Drupal::config('system.site')
+    $this->config('system.site')
       ->set('slogan', $this->originalSlogan)
       ->save();
     $this->drupalGet('admin/config/development/configuration');
diff --git a/core/modules/config/src/Tests/ConfigFileContentTest.php b/core/modules/config/src/Tests/ConfigFileContentTest.php
index 537fdd3..3a62f85 100644
--- a/core/modules/config/src/Tests/ConfigFileContentTest.php
+++ b/core/modules/config/src/Tests/ConfigFileContentTest.php
@@ -56,7 +56,7 @@ function testReadWriteConfig() {
     $false_key = 'false';
 
     // Attempt to read non-existing configuration.
-    $config = \Drupal::config($name);
+    $config = $this->config($name);
 
     // Verify a configuration object is returned.
     $this->assertEqual($config->getName(), $name);
@@ -70,7 +70,7 @@ function testReadWriteConfig() {
     $this->assertIdentical($data, FALSE);
 
     // Add a top level value.
-    $config = \Drupal::config($name);
+    $config = $this->config($name);
     $config->set($key, $value);
 
     // Add a nested value.
@@ -100,7 +100,7 @@ function testReadWriteConfig() {
     $this->assertTrue($data);
 
     // Read top level value.
-    $config = \Drupal::config($name);
+    $config = $this->config($name);
     $this->assertEqual($config->getName(), $name);
     $this->assertTrue($config, 'Config object created.');
     $this->assertEqual($config->get($key), 'bar', 'Top level configuration value found.');
@@ -138,7 +138,7 @@ function testReadWriteConfig() {
     // Unset a nested value.
     $config->clear($nested_key);
     $config->save();
-    $config = \Drupal::config($name);
+    $config = $this->config($name);
 
     // Read unset top level value.
     $this->assertNull($config->get($key), 'Top level value unset.');
@@ -147,13 +147,13 @@ function testReadWriteConfig() {
     $this->assertNull($config->get($nested_key), 'Nested value unset.');
 
     // Create two new configuration files to test listing.
-    $config = \Drupal::config('foo.baz');
+    $config = $this->config('foo.baz');
     $config->set($key, $value);
     $config->save();
 
     // Test chained set()->save().
     $chained_name = 'biff.bang';
-    $config = \Drupal::config($chained_name);
+    $config = $this->config($chained_name);
     $config->set($key, $value)->save();
 
     // Verify the database entry exists from a chained save.
@@ -181,7 +181,7 @@ function testReadWriteConfig() {
     $this->assertEqual($files, array(), 'No files listed with the prefix \'bar\'.');
 
     // Delete the configuration.
-    $config = \Drupal::config($name);
+    $config = $this->config($name);
     $config->delete();
 
     // Verify the database entry no longer exists.
diff --git a/core/modules/config/src/Tests/ConfigImportAllTest.php b/core/modules/config/src/Tests/ConfigImportAllTest.php
index a7ce00d..e1c2ed1 100644
--- a/core/modules/config/src/Tests/ConfigImportAllTest.php
+++ b/core/modules/config/src/Tests/ConfigImportAllTest.php
@@ -78,7 +78,7 @@ public function testInstallUninstall() {
     field_purge_batch(1000);
 
     // Delete any forum terms so it can be uninstalled.
-    $vid = \Drupal::config('forum.settings')->get('vocabulary');
+    $vid = $this->config('forum.settings')->get('vocabulary');
     $terms = entity_load_multiple_by_properties('taxonomy_term', ['vid' => $vid]);
     foreach ($terms as $term) {
       $term->delete();
@@ -140,11 +140,10 @@ public function testInstallUninstall() {
     // conformance. Ensures all imported default configuration is valid when
     // all modules are enabled.
     $names = $this->container->get('config.storage')->listAll();
-    $factory = $this->container->get('config.factory');
     /** @var \Drupal\Core\Config\TypedConfigManagerInterface $typed_config */
     $typed_config = $this->container->get('config.typed');
     foreach ($names as $name) {
-      $config = $factory->get($name);
+      $config = $this->config($name);
       $this->assertConfigSchema($typed_config, $name, $config->get());
     }
   }
diff --git a/core/modules/config/src/Tests/ConfigImportRenameValidationTest.php b/core/modules/config/src/Tests/ConfigImportRenameValidationTest.php
index ea2face..9341f21 100644
--- a/core/modules/config/src/Tests/ConfigImportRenameValidationTest.php
+++ b/core/modules/config/src/Tests/ConfigImportRenameValidationTest.php
@@ -122,7 +122,7 @@ public function testRenameValidation() {
   public function testRenameSimpleConfigValidation() {
     $uuid = new Php();
     // Create a simple configuration with a UUID.
-    $config = \Drupal::config('config_test.new');
+    $config = $this->config('config_test.new');
     $uuid_value = $uuid->generate();
     $config->set('uuid', $uuid_value)->save();
 
@@ -132,7 +132,7 @@ public function testRenameSimpleConfigValidation() {
     $config->delete();
 
     // Create another simple configuration with the same UUID.
-    $config = \Drupal::config('config_test.old');
+    $config = $this->config('config_test.old');
     $config->set('uuid', $uuid_value)->save();
 
     // Confirm that the staged configuration is detected as a rename since the
diff --git a/core/modules/config/src/Tests/ConfigImportUITest.php b/core/modules/config/src/Tests/ConfigImportUITest.php
index b868d35..ac9d4bf 100644
--- a/core/modules/config/src/Tests/ConfigImportUITest.php
+++ b/core/modules/config/src/Tests/ConfigImportUITest.php
@@ -67,7 +67,7 @@ function testImport() {
     // module is used because it creates a table during the install. The Action
     // module is used because it creates a single simple configuration file
     // during the install.
-    $core_extension = \Drupal::config('core.extension')->get();
+    $core_extension = $this->config('core.extension')->get();
     $core_extension['module']['action'] = 0;
     $core_extension['module']['ban'] = 0;
     $core_extension['module'] = module_config_sort($core_extension['module']);
@@ -81,7 +81,7 @@ function testImport() {
     $install_storage = new InstallStorage();
 
     // Set the Bartik theme as default.
-    $system_theme = \Drupal::config('system.theme')->get();
+    $system_theme = $this->config('system.theme')->get();
     $system_theme['default'] = 'bartik';
     $staging->write('system.theme', $system_theme);
 
@@ -123,10 +123,10 @@ function testImport() {
     $this->assertText(t('There are no configuration changes to import.'));
 
     // Verify site name has changed.
-    $this->assertIdentical($new_site_name, \Drupal::config('system.site')->get('name'));
+    $this->assertIdentical($new_site_name, $this->config('system.site')->get('name'));
 
     // Verify that new config entity exists.
-    $this->assertIdentical($original_dynamic_data, \Drupal::config($dynamic_name)->get());
+    $this->assertIdentical($original_dynamic_data, $this->config($dynamic_name)->get());
 
     // Verify the cache got cleared.
     $this->assertTrue(isset($GLOBALS['hook_cache_flush']));
@@ -156,7 +156,7 @@ function testImport() {
     $recursion_limit_values = \Drupal::state()->get('ConfigImportUITest.action.settings.recursion_limit', array());
     $this->assertIdentical($recursion_limit_values, array(50));
 
-    $core_extension = \Drupal::config('core.extension')->get();
+    $core_extension = $this->config('core.extension')->get();
     unset($core_extension['module']['action']);
     unset($core_extension['module']['ban']);
     unset($core_extension['module']['options']);
@@ -166,7 +166,7 @@ function testImport() {
     $staging->delete('action.settings');
     $staging->delete('text.settings');
 
-    $system_theme = \Drupal::config('system.theme')->get();
+    $system_theme = $this->config('system.theme')->get();
     $system_theme['default'] = 'stark';
     $system_theme['admin'] = 'stark';
     $staging->write('system.theme', $system_theme);
@@ -234,7 +234,7 @@ function testImportLock() {
     $this->container->get('lock.persistent')->release($config_importer::LOCK_NAME);
 
     // Verify site name has not changed.
-    $this->assertNotEqual($new_site_name, \Drupal::config('system.site')->get('name'));
+    $this->assertNotEqual($new_site_name, $this->config('system.site')->get('name'));
   }
 
   /**
@@ -243,7 +243,7 @@ function testImportLock() {
   function testImportSiteUuidValidation() {
     $staging = \Drupal::service('config.storage.staging');
     // Create updated configuration object.
-    $config_data = \Drupal::config('system.site')->get();
+    $config_data = $this->config('system.site')->get();
     // Generate a new site UUID.
     $config_data['uuid'] = \Drupal::service('uuid')->generate();
     $staging->write('system.site', $config_data);
@@ -319,13 +319,13 @@ public function testImportValidation() {
     $this->assertText('Config import validate error 2.');
 
     // Verify site name has not changed.
-    $this->assertNotEqual($new_site_name, \Drupal::config('system.site')->get('name'));
+    $this->assertNotEqual($new_site_name, $this->config('system.site')->get('name'));
   }
 
   public function testConfigUninstallConfigException() {
     $staging = $this->container->get('config.storage.staging');
 
-    $core_extension = \Drupal::config('core.extension')->get();
+    $core_extension = $this->config('core.extension')->get();
     unset($core_extension['module']['config']);
     $staging->write('core.extension', $core_extension);
 
@@ -340,7 +340,7 @@ public function testConfigUninstallConfigException() {
   function prepareSiteNameUpdate($new_site_name) {
     $staging = $this->container->get('config.storage.staging');
     // Create updated configuration object.
-    $config_data = \Drupal::config('system.site')->get();
+    $config_data = $this->config('system.site')->get();
     $config_data['name'] = $new_site_name;
     $staging->write('system.site', $config_data);
   }
diff --git a/core/modules/config/src/Tests/ConfigImporterTest.php b/core/modules/config/src/Tests/ConfigImporterTest.php
index 65efbf5..d2c7cf0 100644
--- a/core/modules/config/src/Tests/ConfigImporterTest.php
+++ b/core/modules/config/src/Tests/ConfigImporterTest.php
@@ -71,10 +71,10 @@ function testNoImport() {
     $dynamic_name = 'config_test.dynamic.dotted.default';
 
     // Verify the default configuration values exist.
-    $config = \Drupal::config($dynamic_name);
+    $config = $this->config($dynamic_name);
     $this->assertIdentical($config->get('id'), 'dotted.default');
 
-    // Verify that a bare \Drupal::config() does not involve module APIs.
+    // Verify that a bare $this->config() does not involve module APIs.
     $this->assertFalse(isset($GLOBALS['hook_config_test']));
   }
 
@@ -99,7 +99,7 @@ function testEmptyImportFails() {
   function testSiteUuidValidate() {
     $staging = \Drupal::service('config.storage.staging');
     // Create updated configuration object.
-    $config_data = \Drupal::config('system.site')->get();
+    $config_data = $this->config('system.site')->get();
     // Generate a new site UUID.
     $config_data['uuid'] = \Drupal::service('uuid')->generate();
     $staging->write('system.site', $config_data);
@@ -124,7 +124,7 @@ function testDeleted() {
     $staging = $this->container->get('config.storage.staging');
 
     // Verify the default configuration values exist.
-    $config = \Drupal::config($dynamic_name);
+    $config = $this->config($dynamic_name);
     $this->assertIdentical($config->get('id'), 'dotted.default');
 
     // Delete the file from the staging directory.
@@ -136,7 +136,7 @@ function testDeleted() {
     // Verify the file has been removed.
     $this->assertIdentical($storage->read($dynamic_name), FALSE);
 
-    $config = \Drupal::config($dynamic_name);
+    $config = $this->config($dynamic_name);
     $this->assertIdentical($config->get('id'), NULL);
 
     // Verify that appropriate module API hooks have been invoked.
@@ -183,7 +183,7 @@ function testNew() {
     $this->configImporter->reset()->import();
 
     // Verify the values appeared.
-    $config = \Drupal::config($dynamic_name);
+    $config = $this->config($dynamic_name);
     $this->assertIdentical($config->get('label'), $original_dynamic_data['label']);
 
     // Verify that appropriate module API hooks have been invoked.
@@ -494,9 +494,9 @@ function testUpdated() {
     $staging->write($dynamic_name, $original_dynamic_data);
 
     // Verify the active configuration still returns the default values.
-    $config = \Drupal::config($name);
+    $config = $this->config($name);
     $this->assertIdentical($config->get('foo'), 'bar');
-    $config = \Drupal::config($dynamic_name);
+    $config = $this->config($dynamic_name);
     $this->assertIdentical($config->get('label'), 'Default');
 
     // Import.
@@ -504,9 +504,9 @@ function testUpdated() {
 
     // Verify the values were updated.
     \Drupal::configFactory()->reset($name);
-    $config = \Drupal::config($name);
+    $config = $this->config($name);
     $this->assertIdentical($config->get('foo'), 'beer');
-    $config = \Drupal::config($dynamic_name);
+    $config = $this->config($dynamic_name);
     $this->assertIdentical($config->get('label'), 'Updated');
 
     // Verify that the original file content is still the same.
diff --git a/core/modules/config/src/Tests/ConfigInstallTest.php b/core/modules/config/src/Tests/ConfigInstallTest.php
index 01c3bd8..e21d7c8 100644
--- a/core/modules/config/src/Tests/ConfigInstallTest.php
+++ b/core/modules/config/src/Tests/ConfigInstallTest.php
@@ -33,9 +33,9 @@ function testModuleInstallation() {
     $default_configuration_entity = 'config_test.dynamic.dotted.default';
 
     // Verify that default module config does not exist before installation yet.
-    $config = \Drupal::config($default_config);
+    $config = $this->config($default_config);
     $this->assertIdentical($config->isNew(), TRUE);
-    $config = \Drupal::config($default_configuration_entity);
+    $config = $this->config($default_configuration_entity);
     $this->assertIdentical($config->isNew(), TRUE);
 
     // Ensure that schema provided by modules that are not installed is not
@@ -52,9 +52,9 @@ function testModuleInstallation() {
     // Verify that default module config exists.
     \Drupal::configFactory()->reset($default_config);
     \Drupal::configFactory()->reset($default_configuration_entity);
-    $config = \Drupal::config($default_config);
+    $config = $this->config($default_config);
     $this->assertIdentical($config->isNew(), FALSE);
-    $config = \Drupal::config($default_configuration_entity);
+    $config = $this->config($default_configuration_entity);
     $this->assertIdentical($config->isNew(), FALSE);
 
     // Verify that config_test API hooks were invoked for the dynamic default
@@ -67,11 +67,11 @@ function testModuleInstallation() {
     $this->assertFalse(isset($GLOBALS['hook_config_test']['delete']));
 
     // Ensure that data type casting is applied during config installation.
-    $config = \Drupal::config('config_schema_test.schema_in_install');
+    $config = $this->config('config_schema_test.schema_in_install');
     $this->assertIdentical($config->get('integer'), 1);
 
     // Test that uninstalling configuration removes configuration schema.
-    \Drupal::config('core.extension')->set('module', array())->save();
+    $this->config('core.extension')->set('module', array())->save();
     \Drupal::service('config.manager')->uninstall('module', 'config_test');
     $this->assertFalse(\Drupal::service('config.typed')->hasConfigSchema('config_schema_test.schema_in_install'), 'Configuration schema for config_schema_test.schema_in_install does not exist.');
   }
diff --git a/core/modules/config/src/Tests/ConfigInstallWebTest.php b/core/modules/config/src/Tests/ConfigInstallWebTest.php
index 190e752..5212973 100644
--- a/core/modules/config/src/Tests/ConfigInstallWebTest.php
+++ b/core/modules/config/src/Tests/ConfigInstallWebTest.php
@@ -37,9 +37,9 @@ function testIntegrationModuleReinstallation() {
     \Drupal::service('module_installer')->install(array('config_test'));
 
     // Verify the configuration does not exist prior to installation.
-    $config_static = \Drupal::config($default_config);
+    $config_static = $this->config($default_config);
     $this->assertIdentical($config_static->isNew(), TRUE);
-    $config_entity = \Drupal::config($default_configuration_entity);
+    $config_entity = $this->config($default_configuration_entity);
     $this->assertIdentical($config_entity->isNew(), TRUE);
 
     // Install the integration module.
@@ -48,10 +48,10 @@ function testIntegrationModuleReinstallation() {
     // Verify that default module config exists.
     \Drupal::configFactory()->reset($default_config);
     \Drupal::configFactory()->reset($default_configuration_entity);
-    $config_static = \Drupal::config($default_config);
+    $config_static = $this->config($default_config);
     $this->assertIdentical($config_static->isNew(), FALSE);
     $this->assertIdentical($config_static->get('foo'), 'default setting');
-    $config_entity = \Drupal::config($default_configuration_entity);
+    $config_entity = $this->config($default_configuration_entity);
     $this->assertIdentical($config_entity->isNew(), FALSE);
     $this->assertIdentical($config_entity->get('label'), 'Default integration config label');
 
@@ -60,7 +60,7 @@ function testIntegrationModuleReinstallation() {
     $config_entity->set('label', 'Customized integration config label')->save();
 
     // @todo FIXME: Setting config keys WITHOUT SAVING retains the changed config
-    //   object in memory. Every new call to \Drupal::config() MUST revert in-memory changes
+    //   object in memory. Every new call to $this->config() MUST revert in-memory changes
     //   that haven't been saved!
     //   In other words: This test passes even without this reset, but it shouldn't.
     $this->container->get('config.factory')->reset();
@@ -69,11 +69,11 @@ function testIntegrationModuleReinstallation() {
     $this->container->get('module_installer')->uninstall(array('config_integration_test'));
 
     // Verify the integration module's config was uninstalled.
-    $config_static = \Drupal::config($default_config);
+    $config_static = $this->config($default_config);
     $this->assertIdentical($config_static->isNew(), TRUE);
 
     // Verify the integration config still exists.
-    $config_entity = \Drupal::config($default_configuration_entity);
+    $config_entity = $this->config($default_configuration_entity);
     $this->assertIdentical($config_entity->isNew(), FALSE);
     $this->assertIdentical($config_entity->get('label'), 'Customized integration config label');
 
@@ -83,12 +83,12 @@ function testIntegrationModuleReinstallation() {
     // Verify the integration module's config was re-installed.
     \Drupal::configFactory()->reset($default_config);
     \Drupal::configFactory()->reset($default_configuration_entity);
-    $config_static = \Drupal::config($default_config);
+    $config_static = $this->config($default_config);
     $this->assertIdentical($config_static->isNew(), FALSE);
     $this->assertIdentical($config_static->get('foo'), 'default setting');
 
     // Verify the customized integration config still exists.
-    $config_entity = \Drupal::config($default_configuration_entity);
+    $config_entity = $this->config($default_configuration_entity);
     $this->assertIdentical($config_entity->isNew(), FALSE);
     $this->assertIdentical($config_entity->get('label'), 'Customized integration config label');
   }
@@ -126,7 +126,7 @@ function testInstallProfileConfigOverwrite() {
 
     // Verify that active configuration matches the expected data, which was
     // created from the testing install profile's system.cron.yml file.
-    $config = \Drupal::config($config_name);
+    $config = $this->config($config_name);
     $this->assertIdentical($config->get(), $expected_profile_data);
 
     // Turn on the test module, which will attempt to replace the
@@ -136,14 +136,14 @@ function testInstallProfileConfigOverwrite() {
     $this->assertTrue($status, "The module config_existing_default_config_test was installed.");
 
     // Verify that the test module has not been able to change the data.
-    $config = \Drupal::config($config_name);
+    $config = $this->config($config_name);
     $this->assertIdentical($config->get(), $expected_profile_data);
 
     // Disable and uninstall the test module.
     \Drupal::service('module_installer')->uninstall(array('config_existing_default_config_test'));
 
     // Verify that the data hasn't been altered by removing the test module.
-    $config = \Drupal::config($config_name);
+    $config = $this->config($config_name);
     $this->assertIdentical($config->get(), $expected_profile_data);
   }
 }
diff --git a/core/modules/config/src/Tests/ConfigLanguageOverrideWebTest.php b/core/modules/config/src/Tests/ConfigLanguageOverrideWebTest.php
index be24fb9..b072b63 100644
--- a/core/modules/config/src/Tests/ConfigLanguageOverrideWebTest.php
+++ b/core/modules/config/src/Tests/ConfigLanguageOverrideWebTest.php
@@ -67,7 +67,7 @@ function testSiteNameTranslation() {
     // overrides still work.
     $language_manager = \Drupal::languageManager()->reset();
     $this->assertTrue($language_manager->isMultilingual(), 'The test site is multilingual.');
-    \Drupal::config('system.site')->set('langcode', 'xx')->save();
+    $this->config('system.site')->set('langcode', 'xx')->save();
 
     ConfigurableLanguage::load('en')->delete();
     $this->assertFalse($language_manager->isMultilingual(), 'The test site is monolingual.');
diff --git a/core/modules/config/src/Tests/ConfigModuleOverridesTest.php b/core/modules/config/src/Tests/ConfigModuleOverridesTest.php
index 3a663d5..905b446 100644
--- a/core/modules/config/src/Tests/ConfigModuleOverridesTest.php
+++ b/core/modules/config/src/Tests/ConfigModuleOverridesTest.php
@@ -53,7 +53,7 @@ public function testSimpleModuleOverrides() {
     $this->assertTrue($config->isNew(), 'The configuration object config_override_test.new is new');
     $this->assertIdentical($config->get('module'), 'override');
     $config_factory->setOverrideState(FALSE);
-    $config = \Drupal::config('config_override_test.new');
+    $config = $this->config('config_override_test.new');
     $this->assertIdentical($config->get('module'), NULL);
 
     $config_factory->setOverrideState($old_state);
diff --git a/core/modules/config/src/Tests/ConfigOtherModuleTest.php b/core/modules/config/src/Tests/ConfigOtherModuleTest.php
index 72a332e..5737d78 100644
--- a/core/modules/config/src/Tests/ConfigOtherModuleTest.php
+++ b/core/modules/config/src/Tests/ConfigOtherModuleTest.php
@@ -25,7 +25,7 @@ public function testInstallOtherModuleFirst() {
     // Check that the config entity doesn't exist before the config_test module
     // is enabled. We cannot use the entity system because the config_test
     // entity type does not exist.
-    $config = $this->container->get('config.factory')->get('config_test.dynamic.other_module_test');
+    $config = $this->config('config_test.dynamic.other_module_test');
     $this->assertTrue($config->isNew(), 'Default configuration for other modules is not installed if that module is not enabled.');
 
     // Install the module that provides the entity type. This installs the
@@ -36,7 +36,7 @@ public function testInstallOtherModuleFirst() {
     // Uninstall the module that provides the entity type. This will remove the
     // default configuration.
     $this->uninstallModule('config_test');
-    $config = $this->container->get('config.factory')->get('config_test.dynamic.other_module_test');
+    $config = $this->config('config_test.dynamic.other_module_test');
     $this->assertTrue($config->isNew(), 'Default configuration for other modules is removed when the config entity provider is disabled.');
 
     // Install the module that provides the entity type again. This installs the
diff --git a/core/modules/config/src/Tests/ConfigSchemaTest.php b/core/modules/config/src/Tests/ConfigSchemaTest.php
index 202b552..fc18cfa 100644
--- a/core/modules/config/src/Tests/ConfigSchemaTest.php
+++ b/core/modules/config/src/Tests/ConfigSchemaTest.php
@@ -356,16 +356,16 @@ public function testConfigSaveWithSchema() {
     );
 
     // Save config which has a schema that enforces types.
-    \Drupal::config('config_schema_test.schema_data_types')
+    $this->config('config_schema_test.schema_data_types')
       ->setData($untyped_to_typed)
       ->save();
-    $this->assertIdentical(\Drupal::config('config_schema_test.schema_data_types')->get(), $typed_values);
+    $this->assertIdentical($this->config('config_schema_test.schema_data_types')->get(), $typed_values);
 
     // Save config which does not have a schema that enforces types.
-    \Drupal::config('config_schema_test.no_schema_data_types')
+    $this->config('config_schema_test.no_schema_data_types')
       ->setData($untyped_values)
       ->save();
-    $this->assertIdentical(\Drupal::config('config_schema_test.no_schema_data_types')->get(), $untyped_values);
+    $this->assertIdentical($this->config('config_schema_test.no_schema_data_types')->get(), $untyped_values);
 
     // Ensure that configuration objects with keys marked as ignored are not
     // changed when saved. The 'config_schema_test.ignore' will have been saved
@@ -373,7 +373,7 @@ public function testConfigSaveWithSchema() {
     $extension_path = drupal_get_path('module', 'config_schema_test');
     $install_storage = new FileStorage($extension_path . '/' . InstallStorage::CONFIG_INSTALL_DIRECTORY);
     $original_data = $install_storage->read('config_schema_test.ignore');
-    $this->assertIdentical(\Drupal::config('config_schema_test.ignore')->get(), $original_data);
+    $this->assertIdentical($this->config('config_schema_test.ignore')->get(), $original_data);
   }
 
   /**
diff --git a/core/modules/config/src/Tests/ConfigSingleImportExportTest.php b/core/modules/config/src/Tests/ConfigSingleImportExportTest.php
index 7221be4..8fc7e6a 100644
--- a/core/modules/config/src/Tests/ConfigSingleImportExportTest.php
+++ b/core/modules/config/src/Tests/ConfigSingleImportExportTest.php
@@ -125,7 +125,7 @@ public function testImport() {
    */
   public function testImportSimpleConfiguration() {
     $this->drupalLogin($this->drupalCreateUser(array('import configuration')));
-    $config = \Drupal::config('system.site')->set('name', 'Test simple import');
+    $config = $this->config('system.site')->set('name', 'Test simple import');
     $edit = array(
       'config_type' => 'system.simple',
       'config_name' => $config->getName(),
diff --git a/core/modules/config/src/Tests/ConfigSnapshotTest.php b/core/modules/config/src/Tests/ConfigSnapshotTest.php
index b3789d6..e8ec6d7 100644
--- a/core/modules/config/src/Tests/ConfigSnapshotTest.php
+++ b/core/modules/config/src/Tests/ConfigSnapshotTest.php
@@ -64,7 +64,7 @@ function testSnapshot() {
     $this->assertFalse($active_snapshot_comparer->reset()->hasChanges());
 
     // Change a configuration value in staging.
-    $staging_data = \Drupal::config($config_name)->get();
+    $staging_data = $this->config($config_name)->get();
     $staging_data[$config_key] = $new_data;
     $staging->write($config_name, $staging_data);
 
@@ -78,7 +78,7 @@ function testSnapshot() {
 
     // Verify changed config was properly imported.
     \Drupal::configFactory()->reset($config_name);
-    $this->assertIdentical(\Drupal::config($config_name)->get($config_key), $new_data);
+    $this->assertIdentical($this->config($config_name)->get($config_key), $new_data);
 
     // Verify that a new snapshot was created which and that it matches
     // the active config.
diff --git a/core/modules/config/src/Tests/SchemaCheckTestTrait.php b/core/modules/config/src/Tests/SchemaCheckTestTrait.php
index f4e22b2..9f7cf2a 100644
--- a/core/modules/config/src/Tests/SchemaCheckTestTrait.php
+++ b/core/modules/config/src/Tests/SchemaCheckTestTrait.php
@@ -57,7 +57,7 @@ public function assertConfigSchema(TypedConfigManagerInterface $typed_config, $c
    *   The configuration name.
    */
   public function assertConfigSchemaByName($config_name) {
-    $config = \Drupal::config($config_name);
+    $config = $this->config($config_name);
     $this->assertConfigSchema(\Drupal::service('config.typed'), $config->getName(), $config->get());
   }
 
diff --git a/core/modules/config/src/Tests/SchemaCheckTraitTest.php b/core/modules/config/src/Tests/SchemaCheckTraitTest.php
index a622db8..c0de5d7 100644
--- a/core/modules/config/src/Tests/SchemaCheckTraitTest.php
+++ b/core/modules/config/src/Tests/SchemaCheckTraitTest.php
@@ -48,11 +48,11 @@ protected function setUp() {
    */
   public function testTrait() {
     // Test a non existing schema.
-    $ret = $this->checkConfigSchema($this->typedConfig, 'config_schema_test.noschema', \Drupal::config('config_schema_test.noschema')->get());
+    $ret = $this->checkConfigSchema($this->typedConfig, 'config_schema_test.noschema', $this->config('config_schema_test.noschema')->get());
     $this->assertIdentical($ret, FALSE);
 
     // Test an existing schema with valid data.
-    $config_data = \Drupal::config('config_test.types')->get();
+    $config_data = $this->config('config_test.types')->get();
     $ret = $this->checkConfigSchema($this->typedConfig, 'config_test.types', $config_data);
     $this->assertIdentical($ret, TRUE);
 
diff --git a/core/modules/config/src/Tests/SchemaConfigListenerTest.php b/core/modules/config/src/Tests/SchemaConfigListenerTest.php
index 79d9208..bac6245 100644
--- a/core/modules/config/src/Tests/SchemaConfigListenerTest.php
+++ b/core/modules/config/src/Tests/SchemaConfigListenerTest.php
@@ -30,7 +30,7 @@ public function testConfigSchemaChecker() {
     // Test a non-existing schema.
     $message = 'Expected SchemaIncompleteException thrown';
     try {
-      \Drupal::config('config_schema_test.schemaless')->set('foo', 'bar')->save();
+      $this->config('config_schema_test.schemaless')->set('foo', 'bar')->save();
       $this->fail($message);
     }
     catch (SchemaIncompleteException $e) {
@@ -40,7 +40,7 @@ public function testConfigSchemaChecker() {
 
     // Test a valid schema.
     $message = 'Unexpected SchemaIncompleteException thrown';
-    $config = \Drupal::config('config_test.types')->set('int', 10);
+    $config = $this->config('config_test.types')->set('int', 10);
     try {
       $config->save();
       $this->pass($message);
@@ -51,7 +51,7 @@ public function testConfigSchemaChecker() {
 
     // Test an invalid schema.
     $message = 'Expected SchemaIncompleteException thrown';
-    $config = \Drupal::config('config_test.types')
+    $config = $this->config('config_test.types')
       ->set('foo', 'bar')
       ->set('array', 1);
     try {
diff --git a/core/modules/config/src/Tests/SchemaConfigListenerWebTest.php b/core/modules/config/src/Tests/SchemaConfigListenerWebTest.php
index 01a1cf8..1677214 100644
--- a/core/modules/config/src/Tests/SchemaConfigListenerWebTest.php
+++ b/core/modules/config/src/Tests/SchemaConfigListenerWebTest.php
@@ -31,7 +31,7 @@ public function testConfigSchemaChecker() {
     // Test a non-existing schema.
     $msg = 'Expected SchemaIncompleteException thrown';
     try {
-      \Drupal::config('config_schema_test.schemaless')->set('foo', 'bar')->save();
+      $this->config('config_schema_test.schemaless')->set('foo', 'bar')->save();
       $this->fail($msg);
     }
     catch (SchemaIncompleteException $e) {
@@ -41,7 +41,7 @@ public function testConfigSchemaChecker() {
 
     // Test a valid schema.
     $msg = 'Unexpected SchemaIncompleteException thrown';
-    $config = \Drupal::config('config_test.types')->set('int', 10);
+    $config = $this->config('config_test.types')->set('int', 10);
     try {
       $config->save();
       $this->pass($msg);
@@ -52,7 +52,7 @@ public function testConfigSchemaChecker() {
 
     // Test an invalid schema.
     $msg = 'Expected SchemaIncompleteException thrown';
-    $config = \Drupal::config('config_test.types')
+    $config = $this->config('config_test.types')
       ->set('foo', 'bar')
       ->set('array', 1);
     try {
diff --git a/core/modules/config/src/Tests/Storage/FileStorageTest.php b/core/modules/config/src/Tests/Storage/FileStorageTest.php
index 019aa34..6736bc3 100644
--- a/core/modules/config/src/Tests/Storage/FileStorageTest.php
+++ b/core/modules/config/src/Tests/Storage/FileStorageTest.php
@@ -22,7 +22,7 @@ protected function setUp() {
     $this->invalidStorage = new FileStorage($this->configDirectories[CONFIG_ACTIVE_DIRECTORY] . '/nonexisting');
 
     // FileStorage::listAll() requires other configuration data to exist.
-    $this->storage->write('system.performance', \Drupal::config('system.performance')->get());
+    $this->storage->write('system.performance', $this->config('system.performance')->get());
     $this->storage->write('core.extension', array('module' => array()));
   }
 
diff --git a/core/modules/config_translation/src/Tests/ConfigTranslationListUiTest.php b/core/modules/config_translation/src/Tests/ConfigTranslationListUiTest.php
index 88e60ac..999ebb5 100644
--- a/core/modules/config_translation/src/Tests/ConfigTranslationListUiTest.php
+++ b/core/modules/config_translation/src/Tests/ConfigTranslationListUiTest.php
@@ -77,7 +77,7 @@ protected function setUp() {
 
     // Enable import of translations. By default this is disabled for automated
     // tests.
-    \Drupal::config('locale.settings')
+    $this->config('locale.settings')
       ->set('translation.import_enabled', TRUE)
       ->save();
   }
diff --git a/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php b/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php
index d15d8f3..3d0741b 100644
--- a/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php
+++ b/core/modules/config_translation/src/Tests/ConfigTranslationUiTest.php
@@ -510,9 +510,7 @@ public function testSourceAndTargetLanguage() {
     $this->assertResponse(403);
 
     // Set default language of site information to not-specified language (und).
-    $this->container
-      ->get('config.factory')
-      ->get('system.site')
+    $this->config('system.site')
       ->set('langcode', LanguageInterface::LANGCODE_NOT_SPECIFIED)
       ->save();
 
@@ -583,7 +581,7 @@ public function testViewsTranslationUI() {
   public function testLocaleDBStorage() {
     // Enable import of translations. By default this is disabled for automated
     // tests.
-    \Drupal::config('locale.settings')
+    $this->config('locale.settings')
       ->set('translation.import_enabled', TRUE)
       ->save();
 
diff --git a/core/modules/contact/src/Tests/ContactPersonalTest.php b/core/modules/contact/src/Tests/ContactPersonalTest.php
index b92ad85..340c281 100644
--- a/core/modules/contact/src/Tests/ContactPersonalTest.php
+++ b/core/modules/contact/src/Tests/ContactPersonalTest.php
@@ -53,7 +53,7 @@ protected function setUp() {
     $this->adminUser = $this->drupalCreateUser(array('administer contact forms', 'administer users', 'administer account settings', 'access site reports'));
 
     // Create some normal users with their contact forms enabled by default.
-    \Drupal::config('contact.settings')->set('user_default_enabled', TRUE)->save();
+    $this->config('contact.settings')->set('user_default_enabled', TRUE)->save();
     $this->webUser = $this->drupalCreateUser(array('access user contact forms'));
     $this->contactUser = $this->drupalCreateUser();
   }
@@ -69,11 +69,11 @@ function testSendPersonalContactMessage() {
     $this->assertEqual(1, count($mails));
     $mail = $mails[0];
     $this->assertEqual($mail['to'], $this->contactUser->getEmail());
-    $this->assertEqual($mail['from'], \Drupal::config('system.site')->get('mail'));
+    $this->assertEqual($mail['from'], $this->config('system.site')->get('mail'));
     $this->assertEqual($mail['reply-to'], $this->webUser->getEmail());
     $this->assertEqual($mail['key'], 'user_mail');
     $variables = array(
-      '!site-name' => \Drupal::config('system.site')->get('name'),
+      '!site-name' => $this->config('system.site')->get('name'),
       '!subject' => $message['subject[0][value]'],
       '!recipient-name' => $this->contactUser->getUsername(),
     );
@@ -192,7 +192,7 @@ function testPersonalContactAccess() {
    */
   function testPersonalContactFlood() {
     $flood_limit = 3;
-    \Drupal::config('contact.settings')->set('flood.limit', $flood_limit)->save();
+    $this->config('contact.settings')->set('flood.limit', $flood_limit)->save();
 
     // Clear flood table in preparation for flood test and allow other checks to complete.
     db_delete('flood')->execute();
@@ -209,7 +209,7 @@ function testPersonalContactFlood() {
 
     // Submit contact form one over limit.
     $this->drupalGet('user/' . $this->contactUser->id(). '/contact');
-    $this->assertRaw(t('You cannot send more than %number messages in @interval. Try again later.', array('%number' => $flood_limit, '@interval' => \Drupal::service('date.formatter')->formatInterval(\Drupal::config('contact.settings')->get('flood.interval')))), 'Normal user denied access to flooded contact form.');
+    $this->assertRaw(t('You cannot send more than %number messages in @interval. Try again later.', array('%number' => $flood_limit, '@interval' => \Drupal::service('date.formatter')->formatInterval($this->config('contact.settings')->get('flood.interval')))), 'Normal user denied access to flooded contact form.');
 
     // Test that the admin user can still access the contact form even though
     // the flood limit was reached.
@@ -224,7 +224,7 @@ function testAdminContact() {
     user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access user contact forms'));
     $this->checkContactAccess(200);
     $this->checkContactAccess(403, FALSE);
-    $config = \Drupal::config('contact.settings');
+    $config = $this->config('contact.settings');
     $config->set('user_default_enabled', FALSE);
     $config->save();
     $this->checkContactAccess(403);
@@ -241,7 +241,7 @@ function testAdminContact() {
   protected function checkContactAccess($response, $contact_value = NULL) {
     $this->drupalLogin($this->adminUser);
     $this->drupalGet('admin/people/create');
-    if (\Drupal::config('contact.settings')->get('user_default_enabled', TRUE)) {
+    if ($this->config('contact.settings')->get('user_default_enabled', TRUE)) {
       $this->assertFieldChecked('edit-contact--2');
     }
     else {
diff --git a/core/modules/contact/src/Tests/ContactSitewideTest.php b/core/modules/contact/src/Tests/ContactSitewideTest.php
index 1909a46..66176c4 100644
--- a/core/modules/contact/src/Tests/ContactSitewideTest.php
+++ b/core/modules/contact/src/Tests/ContactSitewideTest.php
@@ -45,7 +45,7 @@ function testSiteWideContact() {
     $this->drupalLogin($admin_user);
 
     $flood_limit = 3;
-    \Drupal::config('contact.settings')
+    $this->config('contact.settings')
       ->set('flood.limit', $flood_limit)
       ->set('flood.interval', 600)
       ->save();
@@ -122,7 +122,7 @@ function testSiteWideContact() {
     $this->assertRaw(t('Contact form %label has been added.', array('%label' => $label)));
 
     // Check that the form was created in site default language.
-    $langcode = \Drupal::config('contact.form.' . $id)->get('langcode');
+    $langcode = $this->config('contact.form.' . $id)->get('langcode');
     $default_langcode = \Drupal::languageManager()->getDefaultLanguage()->getId();
     $this->assertEqual($langcode, $default_langcode);
 
@@ -131,18 +131,18 @@ function testSiteWideContact() {
 
     // Test update contact form.
     $this->updateContactForm($id, $label = $this->randomMachineName(16), $recipients_str = implode(',', array($recipients[0], $recipients[1])), $reply = $this->randomMachineName(30), FALSE);
-    $config = \Drupal::config('contact.form.' . $id)->get();
+    $config = $this->config('contact.form.' . $id)->get();
     $this->assertEqual($config['label'], $label);
     $this->assertEqual($config['recipients'], array($recipients[0], $recipients[1]));
     $this->assertEqual($config['reply'], $reply);
-    $this->assertNotEqual($id, \Drupal::config('contact.settings')->get('default_form'));
+    $this->assertNotEqual($id, $this->config('contact.settings')->get('default_form'));
     $this->assertRaw(t('Contact form %label has been updated.', array('%label' => $label)));
     // Ensure the label is displayed on the contact page for this form.
     $this->drupalGet('contact/' . $id);
     $this->assertText($label);
 
     // Reset the form back to be the default form.
-    \Drupal::config('contact.settings')->set('default_form', $id)->save();
+    $this->config('contact.settings')->set('default_form', $id)->save();
 
     // Ensure that the contact form is shown without a form selection input.
     user_role_grant_permissions(DRUPAL_ANONYMOUS_RID, array('access site-wide contact form'));
@@ -197,7 +197,7 @@ function testSiteWideContact() {
     $this->assertText(t('Message field is required.'));
 
     // Test contact form with no default form selected.
-    \Drupal::config('contact.settings')
+    $this->config('contact.settings')
       ->set('default_form', '')
       ->save();
     $this->drupalGet('contact');
@@ -217,7 +217,7 @@ function testSiteWideContact() {
     // Submit contact form one over limit.
     $this->drupalGet('contact');
     $this->assertResponse(403);
-    $this->assertRaw(t('You cannot send more than %number messages in @interval. Try again later.', array('%number' => \Drupal::config('contact.settings')->get('flood.limit'), '@interval' => \Drupal::service('date.formatter')->formatInterval(600))));
+    $this->assertRaw(t('You cannot send more than %number messages in @interval. Try again later.', array('%number' => $this->config('contact.settings')->get('flood.limit'), '@interval' => \Drupal::service('date.formatter')->formatInterval(600))));
 
     // Test listing controller.
     $this->drupalLogin($admin_user);
@@ -391,7 +391,7 @@ function submitContact($name, $mail, $subject, $id, $message) {
     $edit['mail'] = $mail;
     $edit['subject[0][value]'] = $subject;
     $edit['message[0][value]'] = $message;
-    if ($id == \Drupal::config('contact.settings')->get('default_form')) {
+    if ($id == $this->config('contact.settings')->get('default_form')) {
       $this->drupalPostForm('contact', $edit, t('Send message'));
     }
     else {
diff --git a/core/modules/contact/src/Tests/ContactStorageTest.php b/core/modules/contact/src/Tests/ContactStorageTest.php
index 36edbd9..0110bb0 100644
--- a/core/modules/contact/src/Tests/ContactStorageTest.php
+++ b/core/modules/contact/src/Tests/ContactStorageTest.php
@@ -68,7 +68,7 @@ public function testContactStorage() {
     $this->assertEqual($message->getSubject(), $subject);
     $this->assertEqual($message->getSenderMail(), $mail);
 
-    $config = \Drupal::config("contact.form.$id");
+    $config = $this->config("contact.form.$id");
     $this->assertEqual($config->get('id'), $id);
   }
 
diff --git a/core/modules/content_translation/src/Tests/Views/ContentTranslationViewsUITest.php b/core/modules/content_translation/src/Tests/Views/ContentTranslationViewsUITest.php
index dc2328b..2ae4936 100644
--- a/core/modules/content_translation/src/Tests/Views/ContentTranslationViewsUITest.php
+++ b/core/modules/content_translation/src/Tests/Views/ContentTranslationViewsUITest.php
@@ -35,7 +35,7 @@ class ContentTranslationViewsUITest extends UITestBase {
    */
   public function testViewsUI() {
     $this->drupalGet('admin/structure/views/view/test_view/edit');
-    $this->assertTitle(t('@label (@table) | @site-name', array('@label' => 'Test view', '@table' => 'Views test data', '@site-name' => $this->container->get('config.factory')->get('system.site')->get('name'))));
+    $this->assertTitle(t('@label (@table) | @site-name', array('@label' => 'Test view', '@table' => 'Views test data', '@site-name' => $this->config('system.site')->get('name'))));
   }
 
 }
diff --git a/core/modules/datetime/src/Tests/DateTimeFieldTest.php b/core/modules/datetime/src/Tests/DateTimeFieldTest.php
index aa5239e..35811bc 100644
--- a/core/modules/datetime/src/Tests/DateTimeFieldTest.php
+++ b/core/modules/datetime/src/Tests/DateTimeFieldTest.php
@@ -320,7 +320,7 @@ function testDefaultValue() {
     $this->assertFieldByName('default_value_input[default_date]', '', 'The relative default value is empty in instance settings page');
 
     // Check if default_date has been stored successfully.
-    $config_entity = $this->container->get('config.factory')->get('field.field.node.date_content.' . $field_name)->get();
+    $config_entity = $this->config('field.field.node.date_content.' . $field_name)->get();
     $this->assertEqual($config_entity['default_value'][0], array('default_date_type' => 'now', 'default_date' => 'now'), 'Default value has been stored successfully');
 
     // Clear field cache in order to avoid stale cache values.
@@ -353,7 +353,7 @@ function testDefaultValue() {
     $this->assertFieldByName('default_value_input[default_date]', '+90 days', 'The relative default value is displayed in instance settings page');
 
     // Check if default_date has been stored successfully.
-    $config_entity = $this->container->get('config.factory')->get('field.field.node.date_content.' . $field_name)->get();
+    $config_entity = $this->config('field.field.node.date_content.' . $field_name)->get();
     $this->assertEqual($config_entity['default_value'][0], array('default_date_type' => 'relative', 'default_date' => '+90 days'), 'Default value has been stored successfully');
 
     // Clear field cache in order to avoid stale cache values.
@@ -376,7 +376,7 @@ function testDefaultValue() {
     $this->assertFieldByName('default_value_input[default_date]', '', 'The relative default value is empty in instance settings page');
 
     // Check if default_date has been stored successfully.
-    $config_entity = $this->container->get('config.factory')->get('field.field.node.date_content.' . $field_name)->get();
+    $config_entity = $this->config('field.field.node.date_content.' . $field_name)->get();
     $this->assertTrue(empty($config_entity['default_value']), 'Empty default value has been stored successfully');
 
     // Clear field cache in order to avoid stale cache values.
diff --git a/core/modules/dblog/src/Tests/DbLogTest.php b/core/modules/dblog/src/Tests/DbLogTest.php
index ec34a6c..72be622 100644
--- a/core/modules/dblog/src/Tests/DbLogTest.php
+++ b/core/modules/dblog/src/Tests/DbLogTest.php
@@ -95,7 +95,7 @@ private function verifyRowLimit($row_limit) {
     $this->assertResponse(200);
 
     // Check row limit variable.
-    $current_limit = \Drupal::config('dblog.settings')->get('row_limit');
+    $current_limit = $this->config('dblog.settings')->get('row_limit');
     $this->assertTrue($current_limit == $row_limit, format_string('[Cache] Row limit variable of @count equals row limit of @limit', array('@count' => $current_limit, '@limit' => $row_limit)));
   }
 
diff --git a/core/modules/entity_reference/src/Tests/EntityReferenceFieldDefaultValueTest.php b/core/modules/entity_reference/src/Tests/EntityReferenceFieldDefaultValueTest.php
index 3ccc842..38bc069 100644
--- a/core/modules/entity_reference/src/Tests/EntityReferenceFieldDefaultValueTest.php
+++ b/core/modules/entity_reference/src/Tests/EntityReferenceFieldDefaultValueTest.php
@@ -84,7 +84,7 @@ function testEntityReferenceDefaultValue() {
     $this->assertRaw('name="default_value_input[' . $field_name . '][0][target_id]" value="' . $referenced_node->getTitle() .' (' .$referenced_node->id() . ')', 'The default value is selected in instance settings page');
 
     // Check if the ID has been converted to UUID in config entity.
-    $config_entity = $this->container->get('config.factory')->get('field.field.node.reference_content.' . $field_name)->get();
+    $config_entity = $this->config('field.field.node.reference_content.' . $field_name)->get();
     $this->assertTrue(isset($config_entity['default_value'][0]['target_uuid']), 'Default value contains target_uuid property');
     $this->assertEqual($config_entity['default_value'][0]['target_uuid'], $referenced_node->uuid(), 'Content uuid and config entity uuid are the same');
     // Ensure the configuration has the expected dependency on the entity that
@@ -99,9 +99,9 @@ function testEntityReferenceDefaultValue() {
     $this->assertEqual($new_node->get($field_name)->offsetGet(0)->target_id, $referenced_node->id());
 
     // Ensure that the entity reference config schemas are correct.
-    $field_config = \Drupal::config('field.field.node.reference_content.' . $field_name);
+    $field_config = $this->config('field.field.node.reference_content.' . $field_name);
     $this->assertConfigSchema(\Drupal::service('config.typed'), $field_config->getName(), $field_config->get());
-    $field_storage_config = \Drupal::config('field.storage.node.' . $field_name);
+    $field_storage_config = $this->config('field.storage.node.' . $field_name);
     $this->assertConfigSchema(\Drupal::service('config.typed'), $field_storage_config->getName(), $field_storage_config->get());
   }
 
diff --git a/core/modules/entity_reference/src/Tests/EntityReferenceSelectionAccessTest.php b/core/modules/entity_reference/src/Tests/EntityReferenceSelectionAccessTest.php
index a6edb35..591e619 100644
--- a/core/modules/entity_reference/src/Tests/EntityReferenceSelectionAccessTest.php
+++ b/core/modules/entity_reference/src/Tests/EntityReferenceSelectionAccessTest.php
@@ -242,7 +242,7 @@ public function testUserHandler() {
       ),
     );
 
-    $user_values['anonymous']->name = \Drupal::config('user.settings')->get('anonymous');
+    $user_values['anonymous']->name = $this->config('user.settings')->get('anonymous');
     $users = array();
 
     $user_labels = array();
diff --git a/core/modules/field/src/Tests/FieldCrudTest.php b/core/modules/field/src/Tests/FieldCrudTest.php
index 6fe8316..8806a53 100644
--- a/core/modules/field/src/Tests/FieldCrudTest.php
+++ b/core/modules/field/src/Tests/FieldCrudTest.php
@@ -74,7 +74,7 @@ function testCreateField() {
     // Read the configuration. Check against raw configuration data rather than
     // the loaded ConfigEntity, to be sure we check that the defaults are
     // applied on write.
-    $config = \Drupal::config('field.field.' . $field->id())->get();
+    $config = $this->config('field.field.' . $field->id())->get();
     $field_type_manager = \Drupal::service('plugin.manager.field.field_type');
 
     // Check that default values are set.
diff --git a/core/modules/field/src/Tests/FieldImportDeleteUninstallTest.php b/core/modules/field/src/Tests/FieldImportDeleteUninstallTest.php
index 188cceb..3e83c4d 100644
--- a/core/modules/field/src/Tests/FieldImportDeleteUninstallTest.php
+++ b/core/modules/field/src/Tests/FieldImportDeleteUninstallTest.php
@@ -86,7 +86,7 @@ public function testImportDeleteUninstall() {
     $this->copyConfig($active, $staging);
 
     // Stage uninstall of the Telephone module.
-    $core_extension = \Drupal::config('core.extension')->get();
+    $core_extension = $this->config('core.extension')->get();
     unset($core_extension['module']['telephone']);
     $staging->write('core.extension', $core_extension);
 
@@ -148,7 +148,7 @@ public function testImportAlreadyDeletedUninstall() {
     $this->copyConfig($active, $staging);
 
     // Stage uninstall of the Telephone module.
-    $core_extension = \Drupal::config('core.extension')->get();
+    $core_extension = $this->config('core.extension')->get();
     unset($core_extension['module']['telephone']);
     $staging->write('core.extension', $core_extension);
 
diff --git a/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php b/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php
index 939cfc4..d10b146 100644
--- a/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php
+++ b/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php
@@ -84,7 +84,7 @@ public function testImportDeleteUninstall() {
     $this->copyConfig($active, $staging);
 
     // Stage uninstall of the Telephone module.
-    $core_extension = \Drupal::config('core.extension')->get();
+    $core_extension = $this->config('core.extension')->get();
     unset($core_extension['module']['telephone']);
     $staging->write('core.extension', $core_extension);
 
diff --git a/core/modules/field/src/Tests/FieldStorageCrudTest.php b/core/modules/field/src/Tests/FieldStorageCrudTest.php
index c72e63d..94fb1d2 100644
--- a/core/modules/field/src/Tests/FieldStorageCrudTest.php
+++ b/core/modules/field/src/Tests/FieldStorageCrudTest.php
@@ -51,7 +51,7 @@ function testCreate() {
     // Read the configuration. Check against raw configuration data rather than
     // the loaded ConfigEntity, to be sure we check that the defaults are
     // applied on write.
-    $field_storage_config = \Drupal::config('field.storage.' . $field_storage->id())->get();
+    $field_storage_config = $this->config('field.storage.' . $field_storage->id())->get();
 
     // Ensure that basic properties are preserved.
     $this->assertEqual($field_storage_config['field_name'], $field_storage_definition['field_name'], 'The field name is properly saved.');
diff --git a/core/modules/field/src/Tests/FormTest.php b/core/modules/field/src/Tests/FormTest.php
index 9274624..e8b1323 100644
--- a/core/modules/field/src/Tests/FormTest.php
+++ b/core/modules/field/src/Tests/FormTest.php
@@ -103,7 +103,7 @@ function testFieldFormSingle() {
     $this->drupalGet('entity_test/add');
 
     // Create token value expected for description.
-    $token_description = String::checkPlain(\Drupal::config('system.site')->get('name')) . '_description';
+    $token_description = String::checkPlain($this->config('system.site')->get('name')) . '_description';
     $this->assertText($token_description, 'Token replacement for description is displayed');
     $this->assertFieldByName("{$field_name}[0][value]", '', 'Widget is displayed');
     $this->assertNoField("{$field_name}[1][value]", 'No extraneous widget is displayed');
diff --git a/core/modules/field_ui/src/Tests/EntityDisplayTest.php b/core/modules/field_ui/src/Tests/EntityDisplayTest.php
index 2f47234..0db126a 100644
--- a/core/modules/field_ui/src/Tests/EntityDisplayTest.php
+++ b/core/modules/field_ui/src/Tests/EntityDisplayTest.php
@@ -242,7 +242,7 @@ public function testBaseFieldComponent() {
     // Check that saving the display only writes data for fields whose display
     // is configurable.
     $display->save();
-    $config = \Drupal::config('core.entity_view_display.' . $display->id());
+    $config = $this->config('core.entity_view_display.' . $display->id());
     $data = $config->get();
     $this->assertFalse(isset($data['content']['test_no_display']));
     $this->assertFalse(isset($data['hidden']['test_no_display']));
diff --git a/core/modules/field_ui/src/Tests/EntityFormDisplayTest.php b/core/modules/field_ui/src/Tests/EntityFormDisplayTest.php
index 057d575..b7f5032 100644
--- a/core/modules/field_ui/src/Tests/EntityFormDisplayTest.php
+++ b/core/modules/field_ui/src/Tests/EntityFormDisplayTest.php
@@ -146,7 +146,7 @@ public function testBaseFieldComponent() {
     // Check that saving the display only writes data for fields whose display
     // is configurable.
     $display->save();
-    $config = \Drupal::config('core.entity_form_display.' . $display->id());
+    $config = $this->config('core.entity_form_display.' . $display->id());
     $data = $config->get();
     $this->assertFalse(isset($data['content']['test_no_display']));
     $this->assertFalse(isset($data['hidden']['test_no_display']));
diff --git a/core/modules/field_ui/src/Tests/ManageFieldsTest.php b/core/modules/field_ui/src/Tests/ManageFieldsTest.php
index 335b63b..9efd340 100644
--- a/core/modules/field_ui/src/Tests/ManageFieldsTest.php
+++ b/core/modules/field_ui/src/Tests/ManageFieldsTest.php
@@ -287,7 +287,7 @@ function assertFieldSettings($bundle, $field_name, $string = 'dummy test string'
   function testFieldPrefix() {
     // Change default field prefix.
     $field_prefix = strtolower($this->randomMachineName(10));
-    \Drupal::config('field_ui.settings')->set('field_prefix', $field_prefix)->save();
+    $this->config('field_ui.settings')->set('field_prefix', $field_prefix)->save();
 
     // Create a field input and label exceeding the new maxlength, which is 22.
     $field_exceed_max_length_label = $this->randomString(23);
@@ -422,7 +422,7 @@ function testDeleteField() {
    */
   function testDisallowedFieldNames() {
     // Reset the field prefix so we can test properly.
-    \Drupal::config('field_ui.settings')->set('field_prefix', '')->save();
+    $this->config('field_ui.settings')->set('field_prefix', '')->save();
 
     $label = 'Disallowed field';
     $edit = array(
diff --git a/core/modules/file/src/Tests/DeleteTest.php b/core/modules/file/src/Tests/DeleteTest.php
index f39239f..5f0acc8 100644
--- a/core/modules/file/src/Tests/DeleteTest.php
+++ b/core/modules/file/src/Tests/DeleteTest.php
@@ -60,7 +60,7 @@ function testInUse() {
     // configuration value.
     db_update('file_managed')
       ->fields(array(
-        'changed' => REQUEST_TIME - ($this->container->get('config.factory')->get('system.file')->get('temporary_maximum_age') + 1),
+        'changed' => REQUEST_TIME - ($this->config('system.file')->get('temporary_maximum_age') + 1),
       ))
       ->condition('fid', $file->id())
       ->execute();
diff --git a/core/modules/file/src/Tests/DownloadTest.php b/core/modules/file/src/Tests/DownloadTest.php
index ac81651..84243a3 100644
--- a/core/modules/file/src/Tests/DownloadTest.php
+++ b/core/modules/file/src/Tests/DownloadTest.php
@@ -56,7 +56,7 @@ public function testPrivateFileTransferWithoutPageCache() {
    */
   public function testPrivateFileTransferWithPageCache() {
     // Turn on page caching and rerun the test.
-    $config = \Drupal::config('system.performance');
+    $config = $this->config('system.performance');
     $config->set('cache.page.use_internal', 1);
     $config->set('cache.page.max_age', 300);
     $config->save();
diff --git a/core/modules/file/src/Tests/FileFieldRevisionTest.php b/core/modules/file/src/Tests/FileFieldRevisionTest.php
index bf607ee..3c26f59 100644
--- a/core/modules/file/src/Tests/FileFieldRevisionTest.php
+++ b/core/modules/file/src/Tests/FileFieldRevisionTest.php
@@ -117,7 +117,7 @@ function testRevisions() {
     // configuration value.
     db_update('file_managed')
       ->fields(array(
-        'changed' => REQUEST_TIME - ($this->container->get('config.factory')->get('system.file')->get('temporary_maximum_age') + 1),
+        'changed' => REQUEST_TIME - ($this->config('system.file')->get('temporary_maximum_age') + 1),
       ))
       ->condition('fid', $node_file_r3->id())
       ->execute();
@@ -133,7 +133,7 @@ function testRevisions() {
     // configuration value.
     db_update('file_managed')
       ->fields(array(
-        'changed' => REQUEST_TIME - ($this->container->get('config.factory')->get('system.file')->get('temporary_maximum_age') + 1),
+        'changed' => REQUEST_TIME - ($this->config('system.file')->get('temporary_maximum_age') + 1),
       ))
       ->condition('fid', $node_file_r1->id())
       ->execute();
diff --git a/core/modules/file/src/Tests/RemoteFileSaveUploadTest.php b/core/modules/file/src/Tests/RemoteFileSaveUploadTest.php
index 81f4340..59313bc 100644
--- a/core/modules/file/src/Tests/RemoteFileSaveUploadTest.php
+++ b/core/modules/file/src/Tests/RemoteFileSaveUploadTest.php
@@ -23,6 +23,6 @@ class RemoteFileSaveUploadTest extends SaveUploadTest {
 
   protected function setUp() {
     parent::setUp();
-    \Drupal::config('system.file')->set('default_scheme', 'dummy-remote')->save();
+    $this->config('system.file')->set('default_scheme', 'dummy-remote')->save();
   }
 }
diff --git a/core/modules/file/src/Tests/SaveUploadTest.php b/core/modules/file/src/Tests/SaveUploadTest.php
index 30e681d..3b34f91 100644
--- a/core/modules/file/src/Tests/SaveUploadTest.php
+++ b/core/modules/file/src/Tests/SaveUploadTest.php
@@ -173,7 +173,7 @@ function testHandleExtension() {
    * Test dangerous file handling.
    */
   function testHandleDangerousFile() {
-    $config = \Drupal::config('system.file');
+    $config = $this->config('system.file');
     // Allow the .php extension and make sure it gets renamed to .txt for
     // safety. Also check to make sure its MIME type was changed.
     $edit = array(
@@ -217,7 +217,7 @@ function testHandleDangerousFile() {
    */
   function testHandleFileMunge() {
     // Ensure insecure uploads are disabled for this test.
-    \Drupal::config('system.file')->set('allow_insecure_uploads', 0)->save();
+    $this->config('system.file')->set('allow_insecure_uploads', 0)->save();
     $this->image = file_move($this->image, $this->image->getFileUri() . '.foo.' . $this->image_extension);
 
     // Reset the hook counters to get rid of the 'move' we just called.
diff --git a/core/modules/file/src/Tests/UsageTest.php b/core/modules/file/src/Tests/UsageTest.php
index d251bec..da96c47 100644
--- a/core/modules/file/src/Tests/UsageTest.php
+++ b/core/modules/file/src/Tests/UsageTest.php
@@ -128,7 +128,7 @@ function createTempFiles() {
     db_update('file_managed')
       ->fields(array(
         'status' => 0,
-        'changed' => REQUEST_TIME - $this->container->get('config.factory')->get('system.file')->get('temporary_maximum_age') - 1,
+        'changed' => REQUEST_TIME - $this->config('system.file')->get('temporary_maximum_age') - 1,
       ))
       ->condition('fid', $temp_old->id())
       ->execute();
@@ -145,7 +145,7 @@ function createTempFiles() {
     // Permanent file that is old.
     $perm_old = file_save_data('');
     db_update('file_managed')
-      ->fields(array('changed' => REQUEST_TIME - $this->container->get('config.factory')->get('system.file')->get('temporary_maximum_age') - 1))
+      ->fields(array('changed' => REQUEST_TIME - $this->config('system.file')->get('temporary_maximum_age') - 1))
       ->condition('fid', $temp_old->id())
       ->execute();
     $this->assertTrue(file_exists($perm_old->getFileUri()), 'Old permanent file was created correctly.');
@@ -177,7 +177,7 @@ function testTempFileNoCleanup() {
     list($temp_old, $temp_new, $perm_old, $perm_new) = $this->createTempFiles();
 
     // Set the max age to 0, meaning no temporary files will be deleted.
-    \Drupal::config('system.file')
+    $this->config('system.file')
       ->set('temporary_maximum_age', 0)
       ->save();
 
@@ -196,7 +196,7 @@ function testTempFileCustomCleanup() {
     list($temp_old, $temp_new, $perm_old, $perm_new) = $this->createTempFiles();
 
     // Set the max age to older than default.
-    \Drupal::config('system.file')
+    $this->config('system.file')
       ->set('temporary_maximum_age', 21600 + 2)
       ->save();
 
diff --git a/core/modules/filter/src/Tests/FilterAPITest.php b/core/modules/filter/src/Tests/FilterAPITest.php
index 2808fc1..d4c47bf 100644
--- a/core/modules/filter/src/Tests/FilterAPITest.php
+++ b/core/modules/filter/src/Tests/FilterAPITest.php
@@ -351,21 +351,21 @@ public function testFilterFormatPreSave() {
     $crazy_format->save();
     // Use config to directly load the configuration and check that only enabled
     // or customized plugins are saved to configuration.
-    $filters = \Drupal::config('filter.format.crazy')->get('filters');
+    $filters = $this->config('filter.format.crazy')->get('filters');
     $this->assertEqual(array('filter_html_escape', 'filter_html'), array_keys($filters));
 
     // Disable a plugin to ensure that disabled plugins with custom settings are
     // stored in configuration.
     $crazy_format->setFilterConfig('filter_html_escape', array('status' => FALSE));
     $crazy_format->save();
-    $filters = \Drupal::config('filter.format.crazy')->get('filters');
+    $filters = $this->config('filter.format.crazy')->get('filters');
     $this->assertEqual(array('filter_html_escape', 'filter_html'), array_keys($filters));
 
     // Set the settings as per default to ensure that disable plugins in this
     // state are not stored in configuration.
     $crazy_format->setFilterConfig('filter_html_escape', array('weight' => -10));
     $crazy_format->save();
-    $filters = \Drupal::config('filter.format.crazy')->get('filters');
+    $filters = $this->config('filter.format.crazy')->get('filters');
     $this->assertEqual(array('filter_html'), array_keys($filters));
   }
 
diff --git a/core/modules/filter/src/Tests/FilterAdminTest.php b/core/modules/filter/src/Tests/FilterAdminTest.php
index 67c4dea..1d06df7 100644
--- a/core/modules/filter/src/Tests/FilterAdminTest.php
+++ b/core/modules/filter/src/Tests/FilterAdminTest.php
@@ -290,7 +290,7 @@ function testFilterAdmin() {
     // Use plain text and see if it escapes all tags, whether allowed or not.
     // In order to test plain text, we have to enable the hidden variable for
     // "show_fallback_format", which displays plain text in the format list.
-    \Drupal::config('filter.settings')
+    $this->config('filter.settings')
       ->set('always_show_fallback_choice', TRUE)
       ->save();
     $edit = array();
@@ -298,7 +298,7 @@ function testFilterAdmin() {
     $this->drupalPostForm('node/' . $node->id() . '/edit', $edit, t('Save'));
     $this->drupalGet('node/' . $node->id());
     $this->assertText(String::checkPlain($text), 'The "Plain text" text format escapes all HTML tags.');
-    \Drupal::config('filter.settings')
+    $this->config('filter.settings')
       ->set('always_show_fallback_choice', FALSE)
       ->save();
 
diff --git a/core/modules/filter/src/Tests/FilterUnitTest.php b/core/modules/filter/src/Tests/FilterUnitTest.php
index 00977ab..8d06de7 100644
--- a/core/modules/filter/src/Tests/FilterUnitTest.php
+++ b/core/modules/filter/src/Tests/FilterUnitTest.php
@@ -506,7 +506,7 @@ function testUrlFilter() {
       ),
       // Absolute URL protocols.
       // The list to test is found in the beginning of _filter_url() at
-      // $protocols = \Drupal::config('system.filter')->get('protocols')... (approx line 1555).
+      // $protocols = $this->config('system.filter')->get('protocols')... (approx line 1555).
       '
 https://example.com,
 ftp://ftp.example.com,
diff --git a/core/modules/forum/src/Tests/ForumTest.php b/core/modules/forum/src/Tests/ForumTest.php
index c716f5a..dbd72b8 100644
--- a/core/modules/forum/src/Tests/ForumTest.php
+++ b/core/modules/forum/src/Tests/ForumTest.php
@@ -217,7 +217,7 @@ function testForum() {
    */
   function testAddOrphanTopic() {
     // Must remove forum topics to test creating orphan topics.
-    $vid = \Drupal::config('forum.settings')->get('vocabulary');
+    $vid = $this->config('forum.settings')->get('vocabulary');
     $tids = \Drupal::entityQuery('taxonomy_term')
       ->condition('vid', $vid)
       ->execute();
@@ -322,7 +322,7 @@ private function doAdminTests($user) {
    */
   function editForumVocabulary() {
     // Backup forum taxonomy.
-    $vid = \Drupal::config('forum.settings')->get('vocabulary');
+    $vid = $this->config('forum.settings')->get('vocabulary');
     $original_vocabulary = entity_load('taxonomy_vocabulary', $vid);
 
     // Generate a random name and description.
@@ -388,7 +388,7 @@ function createForum($type, $parent = 0) {
     );
 
     // Verify forum.
-    $term = db_query("SELECT * FROM {taxonomy_term_field_data} t WHERE t.vid = :vid AND t.name = :name AND t.description__value = :desc AND t.default_langcode = 1", array(':vid' => \Drupal::config('forum.settings')->get('vocabulary'), ':name' => $name, ':desc' => $description))->fetchAssoc();
+    $term = db_query("SELECT * FROM {taxonomy_term_field_data} t WHERE t.vid = :vid AND t.name = :name AND t.description__value = :desc AND t.default_langcode = 1", array(':vid' => $this->config('forum.settings')->get('vocabulary'), ':name' => $name, ':desc' => $description))->fetchAssoc();
     $this->assertTrue(!empty($term), 'The ' . $type . ' exists in the database');
 
     // Verify forum hierarchy.
diff --git a/core/modules/forum/src/Tests/ForumUninstallTest.php b/core/modules/forum/src/Tests/ForumUninstallTest.php
index 904ac9d..2dacfbf 100644
--- a/core/modules/forum/src/Tests/ForumUninstallTest.php
+++ b/core/modules/forum/src/Tests/ForumUninstallTest.php
@@ -89,7 +89,7 @@ public function testForumUninstallWithField() {
     $this->assertText('To uninstall Forum first delete all Forums terms');
 
     // Delete any forum terms.
-    $vid = \Drupal::config('forum.settings')->get('vocabulary');
+    $vid = $this->config('forum.settings')->get('vocabulary');
     $terms = entity_load_multiple_by_properties('taxonomy_term', ['vid' => $vid]);
     foreach ($terms as $term) {
       $term->delete();
diff --git a/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php b/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php
index b57ce9f..abe8ffb 100644
--- a/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php
+++ b/core/modules/image/src/Tests/ImageStylesPathAndUrlTest.php
@@ -119,7 +119,7 @@ function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_slash =
 
     // Make the default scheme neither "public" nor "private" to verify the
     // functions work for other than the default scheme.
-    \Drupal::config('system.file')->set('default_scheme', 'temporary')->save();
+    $this->config('system.file')->set('default_scheme', 'temporary')->save();
 
     // Create the directories for the styles.
     $directory = $scheme . '://styles/' . $this->style->id();
@@ -162,11 +162,11 @@ function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_slash =
     // rather than a URI. We need to temporarily switch the default scheme to
     // match the desired scheme before testing this, then switch it back to the
     // "temporary" scheme used throughout this test afterwards.
-    \Drupal::config('system.file')->set('default_scheme', $scheme)->save();
+    $this->config('system.file')->set('default_scheme', $scheme)->save();
     $relative_path = file_uri_target($original_uri);
     $generate_url_from_relative_path = $this->style->buildUrl($relative_path, $clean_url);
     $this->assertEqual($generate_url, $generate_url_from_relative_path);
-    \Drupal::config('system.file')->set('default_scheme', 'temporary')->save();
+    $this->config('system.file')->set('default_scheme', 'temporary')->save();
 
     // Fetch the URL that generates the file.
     $this->drupalGet($generate_url);
@@ -220,7 +220,7 @@ function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_slash =
 
     // Allow insecure image derivatives to be created for the remainder of this
     // test.
-    \Drupal::config('image.settings')->set('allow_insecure_derivatives', TRUE)->save();
+    $this->config('image.settings')->set('allow_insecure_derivatives', TRUE)->save();
 
     // Create another working copy of the file.
     $files = $this->drupalGetTestFiles('image');
@@ -233,7 +233,7 @@ function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_slash =
     // Suppress the security token in the URL, then get the URL of a file that
     // has not been created and try to create it. Check that the security token
     // is not present in the URL but that the image is still accessible.
-    \Drupal::config('image.settings')->set('suppress_itok_output', TRUE)->save();
+    $this->config('image.settings')->set('suppress_itok_output', TRUE)->save();
     $generated_uri = $this->style->buildUri($original_uri);
     $this->assertFalse(file_exists($generated_uri), 'Generated file does not exist.');
     $generate_url = $this->style->buildUrl($original_uri, $clean_url);
@@ -247,7 +247,7 @@ function doImageStyleUrlAndPathTests($scheme, $clean_url = TRUE, $extra_slash =
    */
   protected function enablePageCache() {
     // Turn on page caching and rerun the test.
-    $config = \Drupal::config('system.performance');
+    $config = $this->config('system.performance');
     $config->set('cache.page.use_internal', 1);
     $config->set('cache.page.max_age', 300);
     $config->save();
diff --git a/core/modules/language/src/Tests/LanguageConfigSchemaTest.php b/core/modules/language/src/Tests/LanguageConfigSchemaTest.php
index 56dd719..40fa4e8 100644
--- a/core/modules/language/src/Tests/LanguageConfigSchemaTest.php
+++ b/core/modules/language/src/Tests/LanguageConfigSchemaTest.php
@@ -49,7 +49,7 @@ protected function setUp() {
    */
   function testValidLanguageConfigSchema() {
     // Make sure no language configuration available by default.
-    $config_data = \Drupal::config('language.settings')->get();
+    $config_data = $this->config('language.settings')->get();
     $this->assertTrue(empty($config_data));
 
     $settings_path = 'admin/config/regional/content-language';
@@ -65,7 +65,7 @@ function testValidLanguageConfigSchema() {
 
     $this->drupalPostForm($settings_path, $edit, t('Save configuration'));
 
-    $config_data = \Drupal::config('language.content_settings.menu_link_content.menu_link_content');
+    $config_data = $this->config('language.content_settings.menu_link_content.menu_link_content');
     // Make sure configuration saved correctly.
     $this->assertTrue($config_data->get('language_alterable'));
 
diff --git a/core/modules/language/src/Tests/LanguageConfigurationElementTest.php b/core/modules/language/src/Tests/LanguageConfigurationElementTest.php
index fb50294..c98ef25 100644
--- a/core/modules/language/src/Tests/LanguageConfigurationElementTest.php
+++ b/core/modules/language/src/Tests/LanguageConfigurationElementTest.php
@@ -95,7 +95,7 @@ public function testDefaultLangcode() {
     $configurable_language = entity_load('configurable_language', $old_default->getId());
     $this->assertTrue($configurable_language->isDefault(), 'The en language entity is flagged as the default language.');
 
-    \Drupal::config('system.site')->set('langcode', 'cc')->save();
+    $this->config('system.site')->set('langcode', 'cc')->save();
     ContentLanguageSettings::loadByEntityTypeBundle('entity_test','custom_bundle')
       ->setLanguageAlterable(TRUE)
       ->setDefaultLangcode(LanguageInterface::LANGCODE_SITE_DEFAULT)
diff --git a/core/modules/language/src/Tests/LanguageConfigurationTest.php b/core/modules/language/src/Tests/LanguageConfigurationTest.php
index 32f70e6..27abc6b 100644
--- a/core/modules/language/src/Tests/LanguageConfigurationTest.php
+++ b/core/modules/language/src/Tests/LanguageConfigurationTest.php
@@ -45,7 +45,7 @@ function testLanguageConfiguration() {
     $this->assertText('French');
     $this->assertUrl(\Drupal::url('language.admin_overview', [], ['absolute' => TRUE]), [], 'Correct page redirection.');
     // Langcode for Languages is always 'en'.
-    $language = $this->container->get('config.factory')->get('language.entity.fr')->get();
+    $language = $this->config('language.entity.fr')->get();
     $this->assertEqual($language['langcode'], 'en');
 
     // Check if the Default English language has no path prefix.
@@ -107,7 +107,7 @@ function testLanguageConfiguration() {
       'predefined_langcode' => 'de',
     );
     $this->drupalPostForm('admin/config/regional/language/add', $edit, 'Add language');
-    $language = $this->container->get('config.factory')->get('language.entity.de')->get();
+    $language = $this->config('language.entity.de')->get();
     $this->assertEqual($language['langcode'], 'en');
   }
 
diff --git a/core/modules/language/src/Tests/LanguageDependencyInjectionTest.php b/core/modules/language/src/Tests/LanguageDependencyInjectionTest.php
index b6fc729..1a7a815 100644
--- a/core/modules/language/src/Tests/LanguageDependencyInjectionTest.php
+++ b/core/modules/language/src/Tests/LanguageDependencyInjectionTest.php
@@ -43,7 +43,7 @@ function testDependencyInjectedNewDefaultLanguage() {
     $default_language = ConfigurableLanguage::load(\Drupal::languageManager()->getDefaultLanguage()->getId());
     // Change the language default object to different values.
     ConfigurableLanguage::createFromLangcode('fr')->save();
-    \Drupal::config('system.site')->set('langcode', 'fr')->save();
+    $this->config('system.site')->set('langcode', 'fr')->save();
 
     // The language system creates a Language object which contains the
     // same properties as the new default language object.
@@ -60,7 +60,7 @@ function testDependencyInjectedNewDefaultLanguage() {
     }
 
     // Re-save the previous default language and the delete should work.
-    \Drupal::config('system.site')->set('langcode', $default_language->getId())->save();
+    $this->config('system.site')->set('langcode', $default_language->getId())->save();
 
     entity_delete_multiple('configurable_language', array('fr'));
     $result = \Drupal::languageManager()->getCurrentLanguage();
diff --git a/core/modules/language/src/Tests/LanguageNegotiationInfoTest.php b/core/modules/language/src/Tests/LanguageNegotiationInfoTest.php
index 60fc384..d96e310 100644
--- a/core/modules/language/src/Tests/LanguageNegotiationInfoTest.php
+++ b/core/modules/language/src/Tests/LanguageNegotiationInfoTest.php
@@ -106,7 +106,7 @@ function testInfoAlterations() {
       'language_test.language_negotiation_info_alter' => TRUE,
     ));
 
-    $negotiation = $this->container->get('config.factory')->get('language.types')->get('negotiation.' . $type . '.enabled');
+    $negotiation = $this->config('language.types')->get('negotiation.' . $type . '.enabled');
     $this->assertFalse(isset($negotiation[$interface_method_id]), 'Interface language negotiation method removed from the stored settings.');
 
     $this->drupalGet('admin/config/regional/language/detection');
@@ -149,7 +149,7 @@ function testInfoAlterations() {
 
     // Check that unavailable language negotiation methods are not present in
     // the negotiation settings.
-    $negotiation = $this->container->get('config.factory')->get('language.types')->get('negotiation.' . $type . '.enabled');
+    $negotiation = $this->config('language.types')->get('negotiation.' . $type . '.enabled');
     $this->assertFalse(isset($negotiation[$test_method_id]), 'The disabled test language negotiation method is not part of the content language negotiation settings.');
 
     // Check that configuration page presents the correct options and settings.
@@ -164,7 +164,7 @@ protected function checkFixedLanguageTypes() {
     $configurable = $this->languageManager()->getLanguageTypes();
     foreach ($this->languageManager()->getDefinedLanguageTypesInfo() as $type => $info) {
       if (!in_array($type, $configurable) && isset($info['fixed'])) {
-        $negotiation = $this->container->get('config.factory')->get('language.types')->get('negotiation.' . $type . '.enabled');
+        $negotiation = $this->config('language.types')->get('negotiation.' . $type . '.enabled');
         $equal = count($info['fixed']) == count($negotiation);
         while ($equal && list($id) = each($negotiation)) {
           list(, $info_id) = each($info['fixed']);
diff --git a/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php b/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php
index fb4a3bb..37611cd 100644
--- a/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php
+++ b/core/modules/language/src/Tests/LanguageUILanguageNegotiationTest.php
@@ -91,7 +91,7 @@ function testUILanguageNegotiation() {
     // be some bug.
     $default_language = \Drupal::languageManager()->getDefaultLanguage();
     ConfigurableLanguage::createFromLangcode($langcode_browser_fallback)->save();
-    \Drupal::config('system.site')->set('langcode', $langcode_browser_fallback)->save();
+    $this->config('system.site')->set('langcode', $langcode_browser_fallback)->save();
     ConfigurableLanguage::createFromLangcode($langcode)->save();
 
     // We will look for this string in the admin/config screen to see if the
@@ -104,8 +104,8 @@ function testUILanguageNegotiation() {
     // Now the t()'ed string is in db so switch the language back to default.
     // This will rebuild the container so we need to rebuild the container in
     // the test environment.
-    \Drupal::config('system.site')->set('langcode', $default_language->getId())->save();
-    \Drupal::config('language.negotiation')->set('url.prefixes.en', '')->save();
+    $this->config('system.site')->set('langcode', $default_language->getId())->save();
+    $this->config('language.negotiation')->set('url.prefixes.en', '')->save();
     $this->rebuildContainer();
 
     // Translate the string.
@@ -150,7 +150,7 @@ function testUILanguageNegotiation() {
     $this->runTest($test);
 
     // An invalid language is selected.
-    \Drupal::config('language.negotiation')->set('selected_langcode', NULL)->save();
+    $this->config('language.negotiation')->set('selected_langcode', NULL)->save();
     $test = array(
       'language_negotiation' => array(LanguageNegotiationSelected::METHOD_ID),
       'path' => 'admin/config',
@@ -162,7 +162,7 @@ function testUILanguageNegotiation() {
     $this->runTest($test);
 
     // No selected language is available.
-    \Drupal::config('language.negotiation')->set('selected_langcode', $langcode_unknown)->save();
+    $this->config('language.negotiation')->set('selected_langcode', $langcode_unknown)->save();
     $test = array(
       'language_negotiation' => array(LanguageNegotiationSelected::METHOD_ID),
       'path' => 'admin/config',
@@ -227,7 +227,7 @@ function testUILanguageNegotiation() {
 
     // Unknown language prefix should return 404.
     $definitions = \Drupal::languageManager()->getNegotiator()->getNegotiationMethods();
-    \Drupal::config('language.types')
+    $this->config('language.types')
       ->set('negotiation.' . LanguageInterface::TYPE_INTERFACE . '.enabled', array_flip(array_keys($definitions)))
       ->save();
     $this->drupalGet("$langcode_unknown/admin/config", array(), $http_header_browser_fallback);
@@ -354,7 +354,7 @@ protected function runTest($test) {
       $this->container->get('language_negotiator')->saveConfiguration(LanguageInterface::TYPE_INTERFACE, $method_weights);
     }
     if (!empty($test['language_negotiation_url_part'])) {
-      \Drupal::config('language.negotiation')
+      $this->config('language.negotiation')
         ->set('url.source', $test['language_negotiation_url_part'])
         ->save();
     }
@@ -494,7 +494,7 @@ public function testContentCustomization() {
     $this->drupalPostForm('admin/config/regional/language/detection', $edit, t('Save settings'));
 
     // Check if configurability persisted.
-    $config = \Drupal::config('language.types');
+    $config = $this->config('language.types');
     $this->assertTrue(in_array('language_interface', $config->get('configurable')), 'Interface language is configurable.');
     $this->assertTrue(in_array('language_content', $config->get('configurable')), 'Content language is configurable.');
 
diff --git a/core/modules/language/src/Tests/LanguageUrlRewritingTest.php b/core/modules/language/src/Tests/LanguageUrlRewritingTest.php
index 34d83ae..32a8649 100644
--- a/core/modules/language/src/Tests/LanguageUrlRewritingTest.php
+++ b/core/modules/language/src/Tests/LanguageUrlRewritingTest.php
@@ -114,7 +114,7 @@ function testDomainNameNegotiationPort() {
     $this->rebuildContainer();
 
     // Enable domain configuration.
-    \Drupal::config('language.negotiation')
+    $this->config('language.negotiation')
       ->set('url.source', LanguageNegotiationUrl::CONFIG_DOMAIN)
       ->save();
 
diff --git a/core/modules/locale/src/Tests/LocaleConfigTranslationImportTest.php b/core/modules/locale/src/Tests/LocaleConfigTranslationImportTest.php
index ae914d8..cacf88d 100644
--- a/core/modules/locale/src/Tests/LocaleConfigTranslationImportTest.php
+++ b/core/modules/locale/src/Tests/LocaleConfigTranslationImportTest.php
@@ -36,7 +36,7 @@ protected function setUp() {
 
     // Update module should not go out to d.o to check for updates. We override
     // the url to an invalid update source. No update data will be found.
-    \Drupal::config('update.settings')->set('fetch.url', (string) Url::fromRoute('<front>', array(), array('absolute' => TRUE)))->save();
+    $this->config('update.settings')->set('fetch.url', (string) Url::fromRoute('<front>', array(), array('absolute' => TRUE)))->save();
   }
 
   /**
@@ -54,7 +54,7 @@ public function testConfigTranslationImport() {
 
     // Enable import of translations. By default this is disabled for automated
     // tests.
-    \Drupal::config('locale.settings')
+    $this->config('locale.settings')
       ->set('translation.import_enabled', TRUE)
       ->save();
 
diff --git a/core/modules/locale/src/Tests/LocaleConfigTranslationTest.php b/core/modules/locale/src/Tests/LocaleConfigTranslationTest.php
index 3d26d37..ed3104b 100644
--- a/core/modules/locale/src/Tests/LocaleConfigTranslationTest.php
+++ b/core/modules/locale/src/Tests/LocaleConfigTranslationTest.php
@@ -34,7 +34,7 @@ protected function setUp() {
 
     // Enable import of translations. By default this is disabled for automated
     // tests.
-    \Drupal::config('locale.settings')
+    $this->config('locale.settings')
       ->set('translation.import_enabled', TRUE)
       ->save();
   }
diff --git a/core/modules/locale/src/Tests/LocaleImportFunctionalTest.php b/core/modules/locale/src/Tests/LocaleImportFunctionalTest.php
index 1995214..e0b93fe 100644
--- a/core/modules/locale/src/Tests/LocaleImportFunctionalTest.php
+++ b/core/modules/locale/src/Tests/LocaleImportFunctionalTest.php
@@ -55,7 +55,7 @@ protected function setUp() {
 
     // Enable import of translations. By default this is disabled for automated
     // tests.
-    \Drupal::config('locale.settings')
+    $this->config('locale.settings')
       ->set('translation.import_enabled', TRUE)
       ->save();
   }
@@ -68,7 +68,7 @@ public function testStandalonePoFile() {
     $this->importPoFile($this->getPoFile(), array(
       'langcode' => 'fr',
     ));
-    \Drupal::config('locale.settings');
+    $this->config('locale.settings');
     // The import should automatically create the corresponding language.
     $this->assertRaw(t('The language %language has been created.', array('%language' => 'French')), 'The language has been automatically created.');
 
diff --git a/core/modules/locale/src/Tests/LocaleLocaleLookupTest.php b/core/modules/locale/src/Tests/LocaleLocaleLookupTest.php
index 96f5a26..66f35e6 100644
--- a/core/modules/locale/src/Tests/LocaleLocaleLookupTest.php
+++ b/core/modules/locale/src/Tests/LocaleLocaleLookupTest.php
@@ -32,7 +32,7 @@ public function setUp() {
 
     // Change the language default object to different values.
     ConfigurableLanguage::createFromLangcode('fr')->save();
-    \Drupal::config('system.site')->set('langcode', 'fr')->save();
+    $this->config('system.site')->set('langcode', 'fr')->save();
 
     $this->drupalLogin($this->root_user);
   }
diff --git a/core/modules/locale/src/Tests/LocalePathTest.php b/core/modules/locale/src/Tests/LocalePathTest.php
index d1678af..cb0b86b 100644
--- a/core/modules/locale/src/Tests/LocalePathTest.php
+++ b/core/modules/locale/src/Tests/LocalePathTest.php
@@ -31,7 +31,7 @@ protected function setUp() {
     parent::setUp();
 
     $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
-    \Drupal::config('system.site')->set('page.front', 'node')->save();
+    $this->config('system.site')->set('page.front', 'node')->save();
   }
 
   /**
diff --git a/core/modules/locale/src/Tests/LocaleTranslationUiTest.php b/core/modules/locale/src/Tests/LocaleTranslationUiTest.php
index e9919cd..994eb38 100644
--- a/core/modules/locale/src/Tests/LocaleTranslationUiTest.php
+++ b/core/modules/locale/src/Tests/LocaleTranslationUiTest.php
@@ -205,7 +205,7 @@ public function testStringTranslation() {
   public function testJavaScriptTranslation() {
     $user = $this->drupalCreateUser(array('translate interface', 'administer languages', 'access administration pages'));
     $this->drupalLogin($user);
-    $config = \Drupal::config('locale.settings');
+    $config = $this->config('locale.settings');
 
     $langcode = 'xx';
     // The English name for the language. This will be translated.
diff --git a/core/modules/locale/src/Tests/LocaleUpdateCronTest.php b/core/modules/locale/src/Tests/LocaleUpdateCronTest.php
index 10f0042..8dbee7d 100644
--- a/core/modules/locale/src/Tests/LocaleUpdateCronTest.php
+++ b/core/modules/locale/src/Tests/LocaleUpdateCronTest.php
@@ -36,7 +36,7 @@ public function testUpdateCron() {
 
     // Setup local and remote translations files.
     $this->setTranslationFiles();
-    \Drupal::config('locale.settings')->set('translation.default_filename', '%project-%version.%language._po')->save();
+    $this->config('locale.settings')->set('translation.default_filename', '%project-%version.%language._po')->save();
 
     // Update translations using batch to ensure a clean test starting point.
     $this->drupalGet('admin/reports/translations/check');
diff --git a/core/modules/locale/src/Tests/LocaleUpdateTest.php b/core/modules/locale/src/Tests/LocaleUpdateTest.php
index fffe03c..ad64fe0 100644
--- a/core/modules/locale/src/Tests/LocaleUpdateTest.php
+++ b/core/modules/locale/src/Tests/LocaleUpdateTest.php
@@ -69,7 +69,7 @@ public function testUpdateCheckStatus() {
     $this->drupalGet('admin/reports/translations');
     $this->assertText(t('Missing translations for one project'));
 
-    $config = \Drupal::config('locale.settings');
+    $config = $this->config('locale.settings');
     // Set a flag to let the locale_test module replace the project data with a
     // set of test projects.
     \Drupal::state()->set('locale.test_projects_alter', TRUE);
@@ -121,7 +121,7 @@ public function testUpdateCheckStatus() {
    *  - Import overwrite: all existing translations
    */
   public function testUpdateImportSourceRemote() {
-    $config = \Drupal::config('locale.settings');
+    $config = $this->config('locale.settings');
 
     // Build the test environment.
     $this->setTranslationFiles();
@@ -183,7 +183,7 @@ public function testUpdateImportSourceRemote() {
    *  - Import overwrite: all existing translations
    */
   public function testUpdateImportSourceLocal() {
-    $config = \Drupal::config('locale.settings');
+    $config = $this->config('locale.settings');
 
     // Build the test environment.
     $this->setTranslationFiles();
@@ -237,7 +237,7 @@ public function testUpdateImportSourceLocal() {
    *  - Import overwrite: only overwrite non-customized translations
    */
   public function testUpdateImportModeNonCustomized() {
-    $config = \Drupal::config('locale.settings');
+    $config = $this->config('locale.settings');
 
     // Build the test environment.
     $this->setTranslationFiles();
@@ -273,7 +273,7 @@ public function testUpdateImportModeNonCustomized() {
    *  - Import overwrite: don't overwrite any existing translation
    */
   public function testUpdateImportModeNone() {
-    $config = \Drupal::config('locale.settings');
+    $config = $this->config('locale.settings');
 
     // Build the test environment.
     $this->setTranslationFiles();
diff --git a/core/modules/menu_ui/src/Tests/MenuLanguageTest.php b/core/modules/menu_ui/src/Tests/MenuLanguageTest.php
index 3c920b7..f3bcd15 100644
--- a/core/modules/menu_ui/src/Tests/MenuLanguageTest.php
+++ b/core/modules/menu_ui/src/Tests/MenuLanguageTest.php
@@ -160,7 +160,7 @@ function testMenuLanguageRemovedEnglish() {
 
     // Remove English language. To do that another language has to be set as
     // default.
-    \Drupal::config('system.site')->set('langcode', 'cs')->save();
+    $this->config('system.site')->set('langcode', 'cs')->save();
     entity_delete_multiple('configurable_language', array('en'));
 
     // Save the menu again and check if the language is still the same.
diff --git a/core/modules/menu_ui/src/Tests/MenuTest.php b/core/modules/menu_ui/src/Tests/MenuTest.php
index 098ed0a..41bc2ee 100644
--- a/core/modules/menu_ui/src/Tests/MenuTest.php
+++ b/core/modules/menu_ui/src/Tests/MenuTest.php
@@ -198,7 +198,7 @@ function addCustomMenu() {
     $this->assertText($label, 'Menu created');
 
     // Confirm that the custom menu block is available.
-    $this->drupalGet('admin/structure/block/list/' . \Drupal::config('system.theme')->get('default'));
+    $this->drupalGet('admin/structure/block/list/' . $this->config('system.theme')->get('default'));
     $this->assertText($label);
 
     // Enable the block.
@@ -487,7 +487,7 @@ function testSystemMenuRename() {
     $this->drupalPostForm('admin/structure/menu/manage/main', $edit, t('Save'));
 
     // Make sure menu shows up with new name in block addition.
-    $default_theme = \Drupal::config('system.theme')->get('default');
+    $default_theme = $this->config('system.theme')->get('default');
     $this->drupalget('admin/structure/block/list/' . $default_theme);
     $this->assertText($edit['label']);
   }
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateActionConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateActionConfigsTest.php
index 707d441..5c7daf4 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateActionConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateActionConfigsTest.php
@@ -45,7 +45,7 @@ protected function setUp() {
    * Tests migration of action variables to action.settings.yml.
    */
   public function testActionSettings() {
-    $config = \Drupal::config('action.settings');
+    $config = $this->config('action.settings');
     $this->assertIdentical($config->get('recursion_limit'), 35);
     $this->assertConfigSchema(\Drupal::service('config.typed'), 'action.settings', $config->get());
   }
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorConfigsTest.php
index 49492af..331bdaa 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateAggregatorConfigsTest.php
@@ -45,7 +45,7 @@ protected function setUp() {
    * Tests migration of aggregator variables to aggregator.settings.yml.
    */
   public function testAggregatorSettings() {
-    $config = \Drupal::config('aggregator.settings');
+    $config = $this->config('aggregator.settings');
     $this->assertIdentical($config->get('fetcher'), 'aggregator');
     $this->assertIdentical($config->get('parser'), 'aggregator');
     $this->assertIdentical($config->get('processors'), array('aggregator'));
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php
index 48615f2..9198ce5 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateBlockTest.php
@@ -60,7 +60,7 @@ protected function setUp() {
     ));
 
     // Set Bartik and Seven as the default public and admin theme.
-    $config = \Drupal::config('system.theme');
+    $config = $this->config('system.theme');
     $config->set('default', 'bartik');
     $config->set('admin', 'seven');
     $config->save();
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateBookConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateBookConfigsTest.php
index 98e6501..35de27f 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateBookConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateBookConfigsTest.php
@@ -46,7 +46,7 @@ protected function setUp() {
    * Tests migration of book variables to book.settings.yml.
    */
   public function testBookSettings() {
-    $config = \Drupal::config('book.settings');
+    $config = $this->config('book.settings');
     $this->assertIdentical($config->get('child_type'), 'book');
     $this->assertIdentical($config->get('block.navigation.mode'), 'all pages');
     $this->assertIdentical($config->get('allowed_types'), array('book'));
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateContactConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateContactConfigsTest.php
index 59015f0..e3f0e29 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateContactConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateContactConfigsTest.php
@@ -55,7 +55,7 @@ protected function setUp() {
    * Tests migration of contact variables to contact.settings.yml.
    */
   public function testContactSettings() {
-    $config = \Drupal::config('contact.settings');
+    $config = $this->config('contact.settings');
     $this->assertIdentical($config->get('user_default_enabled'), true);
     $this->assertIdentical($config->get('flood.limit'), 3);
     $this->assertIdentical($config->get('default_form'), 'some_other_category');
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateDblogConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateDblogConfigsTest.php
index 0b4c096..ae2cccc 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateDblogConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateDblogConfigsTest.php
@@ -46,7 +46,7 @@ protected function setUp() {
    * Tests migration of dblog variables to dblog.settings.yml.
    */
   public function testBookSettings() {
-    $config = \Drupal::config('dblog.settings');
+    $config = $this->config('dblog.settings');
     $this->assertIdentical($config->get('row_limit'), 1000);
     $this->assertConfigSchema(\Drupal::service('config.typed'), 'dblog.settings', $config->get());
   }
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6Test.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6Test.php
index c79cf1d..92e9ef4 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6Test.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateDrupal6Test.php
@@ -153,7 +153,7 @@ class MigrateDrupal6Test extends MigrateFullDrupalTestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $config = \Drupal::config('system.theme');
+    $config = $this->config('system.theme');
     $config->set('default', 'bartik');
     $config->set('admin', 'seven');
     $config->save();
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateFileConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateFileConfigsTest.php
index 39b29f2..212c924 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateFileConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateFileConfigsTest.php
@@ -46,7 +46,7 @@ protected function setUp() {
    * Tests migration of file variables to file.settings.yml.
    */
   public function testFileSettings() {
-    $config = \Drupal::config('file.settings');
+    $config = $this->config('file.settings');
     $this->assertIdentical($config->get('description.type'), 'textfield');
     $this->assertIdentical($config->get('description.length'), 128);
     $this->assertIdentical($config->get('icon.directory'), 'sites/default/files/icons');
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateForumConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateForumConfigsTest.php
index 6f3c2bc..1a138ec 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateForumConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateForumConfigsTest.php
@@ -50,7 +50,7 @@ protected function setUp() {
    * Tests migration of forum variables to forum.settings.yml.
    */
   public function testForumSettings() {
-    $config = \Drupal::config('forum.settings');
+    $config = $this->config('forum.settings');
     $this->assertIdentical($config->get('topics.hot_threshold'), 15);
     $this->assertIdentical($config->get('topics.page_limit'), 25);
     $this->assertIdentical($config->get('topics.order'), 1);
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateLocaleConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateLocaleConfigsTest.php
index 2a5889f..e00b134 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateLocaleConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateLocaleConfigsTest.php
@@ -45,7 +45,7 @@ protected function setUp() {
    * Tests migration of locale variables to locale.settings.yml.
    */
   public function testLocaleSettings() {
-    $config = \Drupal::config('locale.settings');
+    $config = $this->config('locale.settings');
     $this->assertIdentical($config->get('cache_strings'), TRUE);
     $this->assertIdentical($config->get('javascript.directory'), 'languages');
     $this->assertConfigSchema(\Drupal::service('config.typed'), 'locale.settings', $config->get());
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuConfigsTest.php
index cc8a89d..dcfc0a7 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateMenuConfigsTest.php
@@ -45,7 +45,7 @@ protected function setUp() {
    * Tests migration of variables for the Menu UI module.
    */
   public function testMenuSettings() {
-    $config = \Drupal::config('menu_ui.settings');
+    $config = $this->config('menu_ui.settings');
     $this->assertIdentical($config->get('override_parent_selector'), FALSE);
     $this->assertConfigSchema(\Drupal::service('config.typed'), 'menu_ui.settings', $config->get());
   }
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeConfigsTest.php
index d2675f2..65960dc 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateNodeConfigsTest.php
@@ -46,7 +46,7 @@ protected function setUp() {
    * Tests Drupal 6 node settings to Drupal 8 migration.
    */
   public function testNodeSettings() {
-    $config = \Drupal::config('node.settings');
+    $config = $this->config('node.settings');
     $this->assertIdentical($config->get('use_admin_theme'), FALSE);
     $this->assertIdentical($config->get('items_per_page'), 3);
     $this->assertConfigSchema(\Drupal::service('config.typed'), 'node.settings', $config->get());
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchConfigsTest.php
index b0a955b..f4a0d44 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSearchConfigsTest.php
@@ -46,7 +46,7 @@ protected function setUp() {
    * Tests migration of search variables to search.settings.yml.
    */
   public function testSearchSettings() {
-    $config = \Drupal::config('search.settings');
+    $config = $this->config('search.settings');
     $this->assertIdentical($config->get('index.minimum_word_size'), 3);
     $this->assertIdentical($config->get('index.overlap_cjk'), TRUE);
     $this->assertIdentical($config->get('index.cron_limit'), 100);
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSimpletestConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSimpletestConfigsTest.php
index 9f857b6..d20c288 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSimpletestConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSimpletestConfigsTest.php
@@ -46,7 +46,7 @@ protected function setUp() {
    * Tests migration of simpletest variables to simpletest.settings.yml.
    */
   public function testSimpletestSettings() {
-    $config = \Drupal::config('simpletest.settings');
+    $config = $this->config('simpletest.settings');
     $this->assertIdentical($config->get('clear_results'), TRUE);
     $this->assertIdentical($config->get('httpauth.method'), CURLAUTH_BASIC);
     // NULL in the dump means defaults which is empty string. Same as omitting
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateStatisticsConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateStatisticsConfigsTest.php
index 283c1c2..c61f2c6 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateStatisticsConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateStatisticsConfigsTest.php
@@ -46,7 +46,7 @@ protected function setUp() {
    * Tests migration of statistics variables to statistics.settings.yml.
    */
   public function testStatisticsSettings() {
-    $config = \Drupal::config('statistics.settings');
+    $config = $this->config('statistics.settings');
     $this->assertIdentical($config->get('access_log.enabled'), FALSE);
     $this->assertIdentical($config->get('access_log.max_lifetime'), 259200);
     $this->assertIdentical($config->get('count_content_views'), 0);
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSyslogConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSyslogConfigsTest.php
index 8b1bd76..02f7f40 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSyslogConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSyslogConfigsTest.php
@@ -45,7 +45,7 @@ protected function setUp() {
    * Tests migration of syslog variables to syslog.settings.yml.
    */
   public function testSyslogSettings() {
-    $config = \Drupal::config('syslog.settings');
+    $config = $this->config('syslog.settings');
     $this->assertIdentical($config->get('identity'), 'drupal');
     $this->assertIdentical($config->get('facility'), '128');
     $this->assertConfigSchema(\Drupal::service('config.typed'), 'syslog.settings', $config->get());
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemCronTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemCronTest.php
index 2bc8216..972883c 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemCronTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemCronTest.php
@@ -36,7 +36,7 @@ protected function setUp() {
    * Tests migration of system (cron) variables to system.cron.yml.
    */
   public function testSystemCron() {
-    $config = \Drupal::config('system.cron');
+    $config = $this->config('system.cron');
     $this->assertIdentical($config->get('threshold.requirements_warning'), 172800);
     $this->assertIdentical($config->get('threshold.requirements_error'), 1209600);
   }
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFileTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFileTest.php
index 19be586..0742d55 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFileTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFileTest.php
@@ -38,7 +38,7 @@ protected function setUp() {
   public function testSystemFile() {
     $old_state = \Drupal::configFactory()->getOverrideState();
     \Drupal::configFactory()->setOverrideState(FALSE);
-    $config = \Drupal::config('system.file');
+    $config = $this->config('system.file');
     $this->assertIdentical($config->get('path.temporary'), 'files/temp');
     $this->assertIdentical($config->get('allow_insecure_uploads'), TRUE);
     \Drupal::configFactory()->setOverrideState($old_state);
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFilterTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFilterTest.php
index 6699186..3a41355 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFilterTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemFilterTest.php
@@ -36,7 +36,7 @@ protected function setUp() {
    * Tests migration of system (filter) variables to system.filter.yml.
    */
   public function testSystemFilter() {
-    $config = \Drupal::config('system.filter');
+    $config = $this->config('system.filter');
     $this->assertIdentical($config->get('protocols'), array('http', 'https', 'ftp', 'news', 'nntp', 'tel', 'telnet', 'mailto', 'irc', 'ssh', 'sftp', 'webcal', 'rtsp'));
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemImageGdTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemImageGdTest.php
index 2020d5f..2e057c8 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemImageGdTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemImageGdTest.php
@@ -36,7 +36,7 @@ protected function setUp() {
    * Tests migration of system (image GD) variables to system.image.gd.yml.
    */
   public function testSystemImageGd() {
-    $config = \Drupal::config('system.image.gd');
+    $config = $this->config('system.image.gd');
     $this->assertIdentical($config->get('jpeg_quality'), 75);
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemImageTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemImageTest.php
index f53c732..db322b5 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemImageTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemImageTest.php
@@ -36,7 +36,7 @@ protected function setUp() {
    * Tests migration of system (image) variables to system.image.yml.
    */
   public function testSystemImage() {
-    $config = \Drupal::config('system.image');
+    $config = $this->config('system.image');
     $this->assertIdentical($config->get('toolkit'), 'gd');
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemLoggingTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemLoggingTest.php
index 25ae285..99bff2b 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemLoggingTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemLoggingTest.php
@@ -38,7 +38,7 @@ protected function setUp() {
    * Tests migration of system error_level variables to system.logging.yml.
    */
   public function testSystemLogging() {
-    $config = \Drupal::config('system.logging');
+    $config = $this->config('system.logging');
     $this->assertIdentical($config->get('error_level'), 'some');
     $this->assertConfigSchema(\Drupal::service('config.typed'), 'system.logging', $config->get());
   }
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemMaintenanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemMaintenanceTest.php
index c9477bd..c2d4ec1 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemMaintenanceTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemMaintenanceTest.php
@@ -36,7 +36,7 @@ protected function setUp() {
    * Tests migration of system (maintenance) variables to system.maintenance.yml.
    */
   public function testSystemMaintenance() {
-    $config = \Drupal::config('system.maintenance');
+    $config = $this->config('system.maintenance');
     $this->assertIdentical($config->get('message'), 'Drupal is currently under maintenance. We should be back shortly. Thank you for your patience.');
   }
 
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemPerformanceTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemPerformanceTest.php
index ccefac8..056ab69 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemPerformanceTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemPerformanceTest.php
@@ -36,7 +36,7 @@ protected function setUp() {
    * Tests migration of system (Performance) variables to system.performance.yml.
    */
   public function testSystemPerformance() {
-    $config = \Drupal::config('system.performance');
+    $config = $this->config('system.performance');
     $this->assertIdentical($config->get('css.preprocess'), FALSE);
     $this->assertIdentical($config->get('js.preprocess'), FALSE);
     $this->assertIdentical($config->get('cache.page.max_age'), 0);
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemRssTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemRssTest.php
index 750d80a..9fc60aa 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemRssTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemRssTest.php
@@ -36,7 +36,7 @@ protected function setUp() {
    * Tests migration of system (rss) variables to system.rss.yml.
    */
   public function testSystemRss() {
-    $config = \Drupal::config('system.rss');
+    $config = $this->config('system.rss');
     $this->assertIdentical($config->get('items.limit'), 10);
     $this->assertIdentical($config->get('items.view_mode'), 'title');
   }
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemSiteTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemSiteTest.php
index 141f533..ecf46ba 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemSiteTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateSystemSiteTest.php
@@ -36,7 +36,7 @@ protected function setUp() {
    * Tests migration of system (site) variables to system.site.yml.
    */
   public function testSystemSite() {
-    $config = \Drupal::config('system.site');
+    $config = $this->config('system.site');
     $this->assertIdentical($config->get('name'), 'site_name');
     $this->assertIdentical($config->get('mail'), 'site_mail@example.com');
     $this->assertIdentical($config->get('slogan'), 'Migrate rocks');
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyConfigsTest.php
index 5426165..c788699 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateTaxonomyConfigsTest.php
@@ -45,7 +45,7 @@ protected function setUp() {
    * Tests migration of taxonomy variables to taxonomy.settings.yml.
    */
   public function testTaxonomySettings() {
-    $config = \Drupal::config('taxonomy.settings');
+    $config = $this->config('taxonomy.settings');
     $this->assertIdentical($config->get('terms_per_page_admin'), 100);
     $this->assertIdentical($config->get('override_selector'), FALSE);
     $this->assertConfigSchema(\Drupal::service('config.typed'), 'taxonomy.settings', $config->get());
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateTextConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateTextConfigsTest.php
index c2b967e..29da7a8 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateTextConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateTextConfigsTest.php
@@ -45,7 +45,7 @@ protected function setUp() {
    * Tests migration of text variables to text.settings.yml.
    */
   public function testTextSettings() {
-    $config = \Drupal::config('text.settings');
+    $config = $this->config('text.settings');
     $this->assertIdentical($config->get('default_summary_length'), 456);
     $this->assertConfigSchema(\Drupal::service('config.typed'), 'text.settings', $config->get());
   }
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUpdateConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUpdateConfigsTest.php
index 92c6c49..413b113 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUpdateConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUpdateConfigsTest.php
@@ -45,7 +45,7 @@ protected function setUp() {
    * Tests migration of update variables to update.settings.yml.
    */
   public function testUpdateSettings() {
-    $config = \Drupal::config('update.settings');
+    $config = $this->config('update.settings');
     $this->assertIdentical($config->get('fetch.max_attempts'), 2);
     $this->assertIdentical($config->get('fetch.url'), 'http://updates.drupal.org/release-history');
     $this->assertIdentical($config->get('notification.threshold'), 'all');
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserConfigsTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserConfigsTest.php
index 278d1cb..3e74fde 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserConfigsTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserConfigsTest.php
@@ -46,7 +46,7 @@ protected function setUp() {
    * Tests migration of user variables to user.mail.yml.
    */
   public function testUserMail() {
-    $config = \Drupal::config('user.mail');
+    $config = $this->config('user.mail');
     $this->assertIdentical($config->get('status_activated.subject'), 'Account details for !username at !site (approved)');
     $this->assertIdentical($config->get('status_activated.body'), "!username,\n\nYour account at !site has been activated.\n\nYou may now log in by clicking on this link or copying and pasting it in your browser:\n\n!login_url\n\nThis is a one-time login, so it can be used only once.\n\nAfter logging in, you will be redirected to !edit_uri so you can change your password.\n\nOnce you have set your own password, you will be able to log in to !login_uri in the future using:\n\nusername: !username\n");
     $this->assertIdentical($config->get('password_reset.subject'), 'Replacement login information for !username at !site');
@@ -68,7 +68,7 @@ public function testUserMail() {
    * Tests migration of user variables to user.settings.yml.
    */
   public function testUserSettings() {
-    $config = \Drupal::config('user.settings');
+    $config = $this->config('user.settings');
     $this->assertIdentical($config->get('notify.status_blocked'), TRUE);
     $this->assertIdentical($config->get('notify.status_activated'), FALSE);
     $this->assertIdentical($config->get('signatures'), TRUE);
diff --git a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php
index 4a187bc..26ddbd3 100644
--- a/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php
+++ b/core/modules/migrate_drupal/src/Tests/d6/MigrateUserTest.php
@@ -168,7 +168,7 @@ public function testUser() {
       // user preferred language is not configured on the site. We just want to
       // test if the value was imported correctly.
       $this->assertEqual($user->preferred_langcode->value, $source->language);
-      $time_zone = $source->expected_timezone ?: \Drupal::config('system.date')->get('timezone.default');
+      $time_zone = $source->expected_timezone ?: $this->config('system.date')->get('timezone.default');
       $this->assertEqual($user->getTimeZone(), $time_zone);
       $this->assertEqual($user->getInitialEmail(), $source->init);
       $this->assertEqual($user->getRoles(), $roles);
diff --git a/core/modules/node/src/Tests/NodeAccessPagerTest.php b/core/modules/node/src/Tests/NodeAccessPagerTest.php
index af4140f..9b5299f 100644
--- a/core/modules/node/src/Tests/NodeAccessPagerTest.php
+++ b/core/modules/node/src/Tests/NodeAccessPagerTest.php
@@ -71,7 +71,7 @@ public function testCommentPager() {
    */
   public function testForumPager() {
     // Look up the forums vocabulary ID.
-    $vid = \Drupal::config('forum.settings')->get('vocabulary');
+    $vid = $this->config('forum.settings')->get('vocabulary');
     $this->assertTrue($vid, 'Forum navigation vocabulary ID is set.');
 
     // Look up the general discussion term.
diff --git a/core/modules/node/src/Tests/NodeAccessTest.php b/core/modules/node/src/Tests/NodeAccessTest.php
index 0e4978b..b96dfa8 100644
--- a/core/modules/node/src/Tests/NodeAccessTest.php
+++ b/core/modules/node/src/Tests/NodeAccessTest.php
@@ -19,7 +19,7 @@ class NodeAccessTest extends NodeTestBase {
   protected function setUp() {
     parent::setUp();
     // Clear permissions for authenticated users.
-    $this->container->get('config.factory')->get('user.role.' . DRUPAL_AUTHENTICATED_RID)->set('permissions', array())->save();
+    $this->config('user.role.' . DRUPAL_AUTHENTICATED_RID)->set('permissions', array())->save();
   }
 
   /**
diff --git a/core/modules/node/src/Tests/NodeCreationTest.php b/core/modules/node/src/Tests/NodeCreationTest.php
index d939dab..7ec85eb 100644
--- a/core/modules/node/src/Tests/NodeCreationTest.php
+++ b/core/modules/node/src/Tests/NodeCreationTest.php
@@ -119,7 +119,7 @@ function testFailedPageCreation() {
    */
   function testUnpublishedNodeCreation() {
     // Set the front page to the test page.
-    \Drupal::config('system.site')->set('page.front', 'test-page')->save();
+    $this->config('system.site')->set('page.front', 'test-page')->save();
 
     // Set "Basic page" content type to be unpublished by default.
     $fields = \Drupal::entityManager()->getFieldDefinitions('node', 'page');
diff --git a/core/modules/node/src/Tests/Views/FrontPageTest.php b/core/modules/node/src/Tests/Views/FrontPageTest.php
index ac93dd3..34ff389 100644
--- a/core/modules/node/src/Tests/Views/FrontPageTest.php
+++ b/core/modules/node/src/Tests/Views/FrontPageTest.php
@@ -43,8 +43,7 @@ protected function setUp() {
    */
   public function testFrontPage() {
     $site_name = $this->randomMachineName();
-    $this->container->get('config.factory')
-      ->get('system.site')
+    $this->config('system.site')
       ->set('name', $site_name)
       ->save();
 
diff --git a/core/modules/node/src/Tests/Views/NodeLanguageTest.php b/core/modules/node/src/Tests/Views/NodeLanguageTest.php
index edf5ae8..0195b44 100644
--- a/core/modules/node/src/Tests/Views/NodeLanguageTest.php
+++ b/core/modules/node/src/Tests/Views/NodeLanguageTest.php
@@ -182,7 +182,7 @@ public function testLanguages() {
     // Override the config for the front page view, so that the language
     // filter is set to the site default language instead. This should just
     // show the English nodes, no matter what the content language is.
-    $config = \Drupal::config('views.view.frontpage');
+    $config = $this->config('views.view.frontpage');
     $config->set('display.default.display_options.filters.langcode.value', array(PluginBase::VIEWS_QUERY_LANGUAGE_SITE_DEFAULT => PluginBase::VIEWS_QUERY_LANGUAGE_SITE_DEFAULT));
     $config->save();
     foreach ($this->node_titles as $langcode => $titles) {
@@ -206,10 +206,10 @@ public function testLanguages() {
     // language configuration!
     $config->set('display.default.display_options.filters.langcode.value', array('***LANGUAGE_language_interface***' => '***LANGUAGE_language_interface***'));
     $config->save();
-    $language_config = \Drupal::config('language.types');
+    $language_config = $this->config('language.types');
     $language_config->set('negotiation.language_interface.enabled', array('language-selected' => 1));
     $language_config->save();
-    $language_config = \Drupal::config('language.negotiation');
+    $language_config = $this->config('language.negotiation');
     $language_config->set('selected_langcode', 'es');
     $language_config->save();
 
diff --git a/core/modules/rest/src/Tests/RESTTestBase.php b/core/modules/rest/src/Tests/RESTTestBase.php
index 2fa0331..105df19 100644
--- a/core/modules/rest/src/Tests/RESTTestBase.php
+++ b/core/modules/rest/src/Tests/RESTTestBase.php
@@ -222,7 +222,7 @@ protected function entityValues($entity_type) {
    */
   protected function enableService($resource_type, $method = 'GET', $format = NULL, $auth = NULL) {
     // Enable REST API for this entity type.
-    $config = \Drupal::config('rest.settings');
+    $config = $this->config('rest.settings');
     $settings = array();
 
     if ($resource_type) {
diff --git a/core/modules/rest/src/Tests/ResourceTest.php b/core/modules/rest/src/Tests/ResourceTest.php
index 1b91551..6814587 100644
--- a/core/modules/rest/src/Tests/ResourceTest.php
+++ b/core/modules/rest/src/Tests/ResourceTest.php
@@ -28,7 +28,7 @@ class ResourceTest extends RESTTestBase {
    */
   protected function setUp() {
     parent::setUp();
-    $this->config = \Drupal::config('rest.settings');
+    $this->config = $this->config('rest.settings');
 
     // Create an entity programmatically.
     $this->entity = $this->entityCreate('entity_test');
diff --git a/core/modules/search/src/Tests/SearchMatchTest.php b/core/modules/search/src/Tests/SearchMatchTest.php
index 5243b52..a24ef09 100644
--- a/core/modules/search/src/Tests/SearchMatchTest.php
+++ b/core/modules/search/src/Tests/SearchMatchTest.php
@@ -33,7 +33,7 @@ function testMatching() {
    * Set up a small index of items to test against.
    */
   function _setup() {
-    \Drupal::config('search.settings')->set('index.minimum_word_size', 3)->save();
+    $this->config('search.settings')->set('index.minimum_word_size', 3)->save();
 
     for ($i = 1; $i <= 7; ++$i) {
       search_index(SEARCH_TYPE, $i, LanguageInterface::LANGCODE_NOT_SPECIFIED, $this->getText($i));
diff --git a/core/modules/search/src/Tests/SearchMultilingualEntityTest.php b/core/modules/search/src/Tests/SearchMultilingualEntityTest.php
index f08e50e..49196be 100644
--- a/core/modules/search/src/Tests/SearchMultilingualEntityTest.php
+++ b/core/modules/search/src/Tests/SearchMultilingualEntityTest.php
@@ -42,7 +42,7 @@ protected function setUp() {
     $this->drupalLogin($user);
 
     // Make sure that auto-cron is disabled.
-    \Drupal::config('system.cron')->set('threshold.autorun', 0)->save();
+    $this->config('system.cron')->set('threshold.autorun', 0)->save();
 
     // Set up the search plugin.
     $this->plugin = $this->container->get('plugin.manager.search')->createInstance('node_search');
@@ -125,7 +125,7 @@ protected function setUp() {
   function testMultilingualSearch() {
     // Index only 2 nodes per cron run. We cannot do this setting in the UI,
     // because it doesn't go this low.
-    \Drupal::config('search.settings')->set('index.cron_limit', 2)->save();
+    $this->config('search.settings')->set('index.cron_limit', 2)->save();
     // Get a new search plugin, to make sure it has this setting.
     $this->plugin = $this->container->get('plugin.manager.search')->createInstance('node_search');
 
@@ -141,7 +141,7 @@ function testMultilingualSearch() {
     // Now index the rest of the nodes.
     // Make sure index throttle is high enough, via the UI.
     $this->drupalPostForm('admin/config/search/pages', array('cron_limit' => 20), t('Save configuration'));
-    $this->assertEqual(20, \Drupal::config('search.settings')->get('index.cron_limit', 100), 'Config setting was saved correctly');
+    $this->assertEqual(20, $this->config('search.settings')->get('index.cron_limit', 100), 'Config setting was saved correctly');
     // Get a new search plugin, to make sure it has this setting.
     $this->plugin = $this->container->get('plugin.manager.search')->createInstance('node_search');
 
diff --git a/core/modules/search/src/Tests/SearchPageTextTest.php b/core/modules/search/src/Tests/SearchPageTextTest.php
index 5cb4865..44572e5 100644
--- a/core/modules/search/src/Tests/SearchPageTextTest.php
+++ b/core/modules/search/src/Tests/SearchPageTextTest.php
@@ -75,7 +75,7 @@ function testSearchText() {
 
     // Test a search input exceeding the limit of AND/OR combinations to test
     // the Denial-of-Service protection.
-    $limit = \Drupal::config('search.settings')->get('and_or_limit');
+    $limit = $this->config('search.settings')->get('and_or_limit');
     $keys = array();
     for ($i = 0; $i < $limit + 1; $i++) {
       // Use a key of 4 characters to ensure we never generate 'AND' or 'OR'.
diff --git a/core/modules/search/src/Tests/SearchRankingTest.php b/core/modules/search/src/Tests/SearchRankingTest.php
index ec725ce..f2fb125 100644
--- a/core/modules/search/src/Tests/SearchRankingTest.php
+++ b/core/modules/search/src/Tests/SearchRankingTest.php
@@ -95,7 +95,7 @@ public function testRankings() {
     $this->drupalPostForm(NULL, $edit, t('Save'));
 
     // Enable counting of statistics.
-    \Drupal::config('statistics.settings')->set('count_content_views', 1)->save();
+    $this->config('statistics.settings')->set('count_content_views', 1)->save();
 
     // Simulating content views is kind of difficult in the test. Leave that
     // to the Statistics module. So instead go ahead and manually update the
diff --git a/core/modules/search/src/Tests/SearchTokenizerTest.php b/core/modules/search/src/Tests/SearchTokenizerTest.php
index efaf09d..a9ca22b 100644
--- a/core/modules/search/src/Tests/SearchTokenizerTest.php
+++ b/core/modules/search/src/Tests/SearchTokenizerTest.php
@@ -26,7 +26,7 @@ class SearchTokenizerTest extends SearchTestBase {
   function testTokenizer() {
     // Set the minimum word size to 1 (to split all CJK characters) and make
     // sure CJK tokenizing is turned on.
-    \Drupal::config('search.settings')
+    $this->config('search.settings')
       ->set('index.minimum_word_size', 1)
       ->set('index.overlap_cjk', TRUE)
       ->save();
@@ -114,7 +114,7 @@ function testTokenizer() {
   function testNoTokenizer() {
     // Set the minimum word size to 1 (to split all CJK characters) and make
     // sure CJK tokenizing is turned on.
-    \Drupal::config('search.settings')
+    $this->config('search.settings')
       ->set('index.minimum_word_size', 1)
       ->set('index.overlap_cjk', TRUE)
       ->save();
diff --git a/core/modules/shortcut/src/Tests/ShortcutLinksTest.php b/core/modules/shortcut/src/Tests/ShortcutLinksTest.php
index d029073..d9cb0c7 100644
--- a/core/modules/shortcut/src/Tests/ShortcutLinksTest.php
+++ b/core/modules/shortcut/src/Tests/ShortcutLinksTest.php
@@ -100,8 +100,8 @@ public function testShortcutLinkAdd() {
    */
   public function testShortcutQuickLink() {
     \Drupal::service('theme_handler')->install(array('seven'));
-    \Drupal::config('system.theme')->set('admin', 'seven')->save();
-    $this->container->get('config.factory')->get('node.settings')->set('use_admin_theme', '1')->save();
+    $this->config('system.theme')->set('admin', 'seven')->save();
+    $this->config('node.settings')->set('use_admin_theme', '1')->save();
     $this->container->get('router.builder')->rebuild();
 
     $this->drupalLogin($this->root_user);
@@ -206,7 +206,7 @@ public function testShortcutLinkDelete() {
   public function testNoShortcutLink() {
     // Change to a theme that displays shortcuts.
     \Drupal::service('theme_handler')->install(array('seven'));
-    \Drupal::config('system.theme')
+    $this->config('system.theme')
       ->set('default', 'seven')
       ->save();
 
@@ -237,7 +237,7 @@ public function testNoShortcutLink() {
   public function testAccessShortcutsPermission() {
     // Change to a theme that displays shortcuts.
     \Drupal::service('theme_handler')->install(array('seven'));
-    \Drupal::config('system.theme')
+    $this->config('system.theme')
       ->set('default', 'seven')
       ->save();
 
diff --git a/core/modules/simpletest/src/KernelTestBase.php b/core/modules/simpletest/src/KernelTestBase.php
index f26c5d4..6991181 100644
--- a/core/modules/simpletest/src/KernelTestBase.php
+++ b/core/modules/simpletest/src/KernelTestBase.php
@@ -203,7 +203,7 @@ protected function setUp() {
       $this->enableModules($modules);
     }
     // In order to use theme functions default theme config needs to exist.
-    \Drupal::config('system.theme')->set('default', 'classy');
+    $this->config('system.theme')->set('default', 'classy');
 
     // Tests based on this class are entitled to use Drupal's File and
     // StreamWrapper APIs.
diff --git a/core/modules/simpletest/src/TestBase.php b/core/modules/simpletest/src/TestBase.php
index d414afc..998f72e 100644
--- a/core/modules/simpletest/src/TestBase.php
+++ b/core/modules/simpletest/src/TestBase.php
@@ -798,7 +798,7 @@ public function run(array $methods = array()) {
     }
 
     TestServiceProvider::$currentTest = $this;
-    $simpletest_config = \Drupal::config('simpletest.settings');
+    $simpletest_config = $this->config('simpletest.settings');
 
     // Unless preset from run-tests.sh, retrieve the current verbose setting.
     if (!isset($this->verbose)) {
@@ -1516,4 +1516,23 @@ public function copyConfig(StorageInterface $source_storage, StorageInterface $t
       $target_storage->write($name, $source_storage->read($name));
     }
   }
+
+  /**
+   * Configuration accessor for tests. Returns non-overriden configuration.
+   *
+   * @param $name
+   *   Configuration name.
+   *
+   * @return \Drupal\Core\Config\Config
+   *   The configuration object with original configuration data.
+   */
+  public function config($name) {
+    $config_factory = \Drupal::configFactory();
+    $old_state = $config_factory->getOverrideState();
+    $config_factory->setOverrideState(FALSE);
+    $config = $config_factory->get($name);
+    $config_factory->setOverrideState($old_state);
+    return $config;
+  }
+
 }
diff --git a/core/modules/simpletest/src/Tests/KernelTestBaseTest.php b/core/modules/simpletest/src/Tests/KernelTestBaseTest.php
index 62612dd..270e08c 100644
--- a/core/modules/simpletest/src/Tests/KernelTestBaseTest.php
+++ b/core/modules/simpletest/src/Tests/KernelTestBaseTest.php
@@ -207,7 +207,7 @@ function testInstallConfig() {
     $this->enableModules(array('user'));
     $this->installConfig(array('user'));
     $this->assertTrue($this->container->get('config.storage')->exists('user.settings'));
-    $this->assertTrue(\Drupal::config('user.settings')->get('register'));
+    $this->assertTrue($this->config('user.settings')->get('register'));
   }
 
   /**
@@ -285,7 +285,7 @@ function testEnableModulesTheme() {
    * Tests that there is no theme by default.
    */
   function testNoThemeByDefault() {
-    $themes = $this->container->get('config.factory')->get('core.extension')->get('theme');
+    $themes = $this->config('core.extension')->get('theme');
     $this->assertEqual($themes, array());
 
     $extensions = $this->container->get('config.storage')->read('core.extension');
diff --git a/core/modules/simpletest/src/Tests/SimpleTestBrowserTest.php b/core/modules/simpletest/src/Tests/SimpleTestBrowserTest.php
index 33fedd8..a5b9703 100644
--- a/core/modules/simpletest/src/Tests/SimpleTestBrowserTest.php
+++ b/core/modules/simpletest/src/Tests/SimpleTestBrowserTest.php
@@ -37,7 +37,7 @@ public function testInternalBrowser() {
     $this->drupalGet('test-page');
     $this->assertTrue($this->drupalGetHeader('Date'), 'An HTTP header was received.');
     $this->assertTitle(t('Test page | @site-name', array(
-      '@site-name' => \Drupal::config('system.site')->get('name'),
+      '@site-name' => $this->config('system.site')->get('name'),
     )));
     $this->assertNoTitle('Foo');
 
diff --git a/core/modules/simpletest/src/WebTestBase.php b/core/modules/simpletest/src/WebTestBase.php
index 1f62ef4..4109d83 100644
--- a/core/modules/simpletest/src/WebTestBase.php
+++ b/core/modules/simpletest/src/WebTestBase.php
@@ -374,7 +374,7 @@ protected function drupalPlaceBlock($plugin_id, array $settings = array()) {
       'plugin' => $plugin_id,
       'region' => 'sidebar_first',
       'id' => strtolower($this->randomMachineName(8)),
-      'theme' => \Drupal::config('system.theme')->get('default'),
+      'theme' => $this->config('system.theme')->get('default'),
       'label' => $this->randomMachineName(8),
       'visibility' => array(),
       'weight' => 0,
diff --git a/core/modules/statistics/src/Tests/StatisticsAdminTest.php b/core/modules/statistics/src/Tests/StatisticsAdminTest.php
index 63af122..d2561a9 100644
--- a/core/modules/statistics/src/Tests/StatisticsAdminTest.php
+++ b/core/modules/statistics/src/Tests/StatisticsAdminTest.php
@@ -62,13 +62,13 @@ protected function setUp() {
    * Verifies that the statistics settings page works.
    */
   function testStatisticsSettings() {
-    $config = \Drupal::config('statistics.settings');
+    $config = $this->config('statistics.settings');
     $this->assertFalse($config->get('count_content_views'), 'Count content view log is disabled by default.');
 
     // Enable counter on content view.
     $edit['statistics_count_content_views'] = 1;
     $this->drupalPostForm('admin/config/system/statistics', $edit, t('Save configuration'));
-    $config = \Drupal::config('statistics.settings');
+    $config = $this->config('statistics.settings');
     $this->assertTrue($config->get('count_content_views'), 'Count content view log is enabled.');
 
     // Hit the node.
@@ -95,7 +95,7 @@ function testStatisticsSettings() {
    * Tests that when a node is deleted, the node counter is deleted too.
    */
   function testDeleteNode() {
-    \Drupal::config('statistics.settings')->set('count_content_views', 1)->save();
+    $this->config('statistics.settings')->set('count_content_views', 1)->save();
 
     $this->drupalGet('node/' . $this->testNode->id());
     // Manually calling statistics.php, simulating ajax behavior.
@@ -126,7 +126,7 @@ function testDeleteNode() {
    * Tests that cron clears day counts and expired access logs.
    */
   function testExpiredLogs() {
-    \Drupal::config('statistics.settings')
+    $this->config('statistics.settings')
       ->set('count_content_views', 1)
       ->save();
     \Drupal::state()->set('statistics.day_timestamp', 8640000);
diff --git a/core/modules/statistics/src/Tests/StatisticsLoggingTest.php b/core/modules/statistics/src/Tests/StatisticsLoggingTest.php
index ff1d8ae..cc792cd 100644
--- a/core/modules/statistics/src/Tests/StatisticsLoggingTest.php
+++ b/core/modules/statistics/src/Tests/StatisticsLoggingTest.php
@@ -54,7 +54,7 @@ protected function setUp() {
     $this->node = $this->drupalCreateNode(array('title' => $this->randomMachineName(255), 'uid' => $this->authUser->id()));
 
     // Enable access logging.
-    \Drupal::config('statistics.settings')
+    $this->config('statistics.settings')
       ->set('count_content_views', 1)
       ->save();
 
diff --git a/core/modules/statistics/src/Tests/StatisticsTestBase.php b/core/modules/statistics/src/Tests/StatisticsTestBase.php
index c6604d4..077267e 100644
--- a/core/modules/statistics/src/Tests/StatisticsTestBase.php
+++ b/core/modules/statistics/src/Tests/StatisticsTestBase.php
@@ -48,7 +48,7 @@ protected function setUp() {
     $this->drupalLogin($this->blockingUser);
 
     // Enable logging.
-    \Drupal::config('statistics.settings')
+    $this->config('statistics.settings')
       ->set('count_content_views', 1)
       ->save();
   }
diff --git a/core/modules/statistics/src/Tests/Views/IntegrationTest.php b/core/modules/statistics/src/Tests/Views/IntegrationTest.php
index b26745a..d83a387 100644
--- a/core/modules/statistics/src/Tests/Views/IntegrationTest.php
+++ b/core/modules/statistics/src/Tests/Views/IntegrationTest.php
@@ -59,7 +59,7 @@ protected function setUp() {
     $this->node = $this->drupalCreateNode(array('type' => 'page'));
 
     // Enable access logging.
-    $this->container->get('config.factory')->get('statistics.settings')
+    $this->config('statistics.settings')
       ->set('access_log.enabled', 1)
       ->set('count_content_views', 1)
       ->save();
diff --git a/core/modules/system/src/Tests/Ajax/AjaxFormPageCacheTest.php b/core/modules/system/src/Tests/Ajax/AjaxFormPageCacheTest.php
index 3d9ffa2..9da0935 100644
--- a/core/modules/system/src/Tests/Ajax/AjaxFormPageCacheTest.php
+++ b/core/modules/system/src/Tests/Ajax/AjaxFormPageCacheTest.php
@@ -20,7 +20,7 @@ class AjaxFormPageCacheTest extends AjaxTestBase {
   public function setUp() {
     parent::setUp();
 
-    $config = \Drupal::config('system.performance');
+    $config = $this->config('system.performance');
     $config->set('cache.page.use_internal', 1);
     $config->set('cache.page.max_age', 300);
     $config->save();
diff --git a/core/modules/system/src/Tests/Ajax/FrameworkTest.php b/core/modules/system/src/Tests/Ajax/FrameworkTest.php
index cded8cb..5b4d2a3 100644
--- a/core/modules/system/src/Tests/Ajax/FrameworkTest.php
+++ b/core/modules/system/src/Tests/Ajax/FrameworkTest.php
@@ -193,7 +193,7 @@ public function testLazyLoadOverriddenCSS() {
     // The test theme overrides system.module.css without an implementation,
     // thereby removing it.
     \Drupal::service('theme_handler')->install(array('test_theme'));
-    \Drupal::config('system.theme')
+    $this->config('system.theme')
       ->set('default', 'test_theme')
       ->save();
 
diff --git a/core/modules/system/src/Tests/Batch/PageTest.php b/core/modules/system/src/Tests/Batch/PageTest.php
index 42800b7..1dd7628 100644
--- a/core/modules/system/src/Tests/Batch/PageTest.php
+++ b/core/modules/system/src/Tests/Batch/PageTest.php
@@ -30,7 +30,7 @@ function testBatchProgressPageTheme() {
     // Make sure that the page which starts the batch (an administrative page)
     // is using a different theme than would normally be used by the batch API.
     $this->container->get('theme_handler')->install(array('seven', 'bartik'));
-    $this->container->get('config.factory')->get('system.theme')
+    $this->config('system.theme')
       ->set('default', 'bartik')
       ->set('admin', 'seven')
       ->save();
diff --git a/core/modules/system/src/Tests/Bootstrap/PageCacheTest.php b/core/modules/system/src/Tests/Bootstrap/PageCacheTest.php
index 9a11d1b..a016161 100644
--- a/core/modules/system/src/Tests/Bootstrap/PageCacheTest.php
+++ b/core/modules/system/src/Tests/Bootstrap/PageCacheTest.php
@@ -31,7 +31,7 @@ class PageCacheTest extends WebTestBase {
   protected function setUp() {
     parent::setUp();
 
-    \Drupal::config('system.site')
+    $this->config('system.site')
       ->set('name', 'Drupal')
       ->set('page.front', 'test-page')
       ->save();
@@ -44,7 +44,7 @@ protected function setUp() {
    * persisted.
    */
   function testPageCacheTags() {
-    $config = \Drupal::config('system.performance');
+    $config = $this->config('system.performance');
     $config->set('cache.page.use_internal', 1);
     $config->set('cache.page.max_age', 300);
     $config->save();
@@ -79,7 +79,7 @@ function testPageCacheTags() {
    * Tests support for different cache items with different Accept headers.
    */
   function testAcceptHeaderRequests() {
-    $config = \Drupal::config('system.performance');
+    $config = $this->config('system.performance');
     $config->set('cache.page.use_internal', 1);
     $config->set('cache.page.max_age', 300);
     $config->save();
@@ -106,7 +106,7 @@ function testAcceptHeaderRequests() {
    * Tests support of requests with If-Modified-Since and If-None-Match headers.
    */
   function testConditionalRequests() {
-    $config = \Drupal::config('system.performance');
+    $config = $this->config('system.performance');
     $config->set('cache.page.use_internal', 1);
     $config->set('cache.page.max_age', 300);
     $config->save();
@@ -151,7 +151,7 @@ function testConditionalRequests() {
    * Tests cache headers.
    */
   function testPageCache() {
-    $config = \Drupal::config('system.performance');
+    $config = $this->config('system.performance');
     $config->set('cache.page.use_internal', 1);
     $config->set('cache.page.max_age', 300);
     $config->set('response.gzip', 1);
@@ -197,7 +197,7 @@ function testPageCache() {
    * Tests the omit_vary_cookie setting.
    */
   public function testPageCacheWithoutVaryCookie() {
-    $config = \Drupal::config('system.performance');
+    $config = $this->config('system.performance');
     $config->set('cache.page.use_internal', 1);
     $config->set('cache.page.max_age', 300);
     $config->save();
@@ -227,7 +227,7 @@ public function testPageCacheWithoutVaryCookie() {
    * mod_deflate Apache module.
    */
   function testPageCompression() {
-    $config = \Drupal::config('system.performance');
+    $config = $this->config('system.performance');
     $config->set('cache.page.use_internal', 1);
     $config->set('cache.page.max_age', 300);
     $config->set('response.gzip', 1);
@@ -250,7 +250,7 @@ function testPageCompression() {
     $this->drupalGet('');
     $this->assertEqual($this->drupalGetHeader('X-Drupal-Cache'), 'HIT', 'Page was cached.');
     $this->assertFalse($this->drupalGetHeader('Content-Encoding'), 'A Content-Encoding header was not sent.');
-    $this->assertTitle(t('Test page | @site-name', array('@site-name' => \Drupal::config('system.site')->get('name'))), 'Site title matches.');
+    $this->assertTitle(t('Test page | @site-name', array('@site-name' => $this->config('system.site')->get('name'))), 'Site title matches.');
     $this->assertRaw('</html>', 'Page was not compressed.');
 
     // Disable compression mode.
diff --git a/core/modules/system/src/Tests/Cache/PageCacheTagsIntegrationTest.php b/core/modules/system/src/Tests/Cache/PageCacheTagsIntegrationTest.php
index 0109bf1..1991a31 100644
--- a/core/modules/system/src/Tests/Cache/PageCacheTagsIntegrationTest.php
+++ b/core/modules/system/src/Tests/Cache/PageCacheTagsIntegrationTest.php
@@ -27,7 +27,7 @@ class PageCacheTagsIntegrationTest extends WebTestBase {
   protected function setUp() {
     parent::setUp();
 
-    $config = \Drupal::config('system.performance');
+    $config = $this->config('system.performance');
     $config->set('cache.page.use_internal', 1);
     $config->set('cache.page.max_age', 300);
     $config->save();
diff --git a/core/modules/system/src/Tests/Cache/PageCacheTagsTestBase.php b/core/modules/system/src/Tests/Cache/PageCacheTagsTestBase.php
index 1da3a56..864fd93 100644
--- a/core/modules/system/src/Tests/Cache/PageCacheTagsTestBase.php
+++ b/core/modules/system/src/Tests/Cache/PageCacheTagsTestBase.php
@@ -29,7 +29,7 @@ protected function setUp() {
     parent::setUp();
 
     // Enable page caching.
-    $config = \Drupal::config('system.performance');
+    $config = $this->config('system.performance');
     $config->set('cache.page.use_internal', 1);
     $config->set('cache.page.max_age', 3600);
     $config->save();
diff --git a/core/modules/system/src/Tests/Common/AttachedAssetsTest.php b/core/modules/system/src/Tests/Common/AttachedAssetsTest.php
index b502b2c..012e2f7 100644
--- a/core/modules/system/src/Tests/Common/AttachedAssetsTest.php
+++ b/core/modules/system/src/Tests/Common/AttachedAssetsTest.php
@@ -39,7 +39,7 @@ protected function setUp() {
     parent::setUp();
 
     // Disable preprocessing.
-    \Drupal::config('system.performance')
+    $this->config('system.performance')
       ->set('css.preprocess', FALSE)
       ->set('js.preprocess', FALSE)
       ->save();
@@ -146,7 +146,7 @@ function testAttributes() {
    */
   function testAggregatedAttributes() {
     // Enable aggregation.
-    \Drupal::config('system.performance')->set('js.preprocess', 1)->save();
+    $this->config('system.performance')->set('js.preprocess', 1)->save();
 
     $build['#attached']['library'][] = 'common_test/js-attributes';
     drupal_process_attached($build);
diff --git a/core/modules/system/src/Tests/Common/FormatDateTest.php b/core/modules/system/src/Tests/Common/FormatDateTest.php
index f8ad3b7..63576fe 100644
--- a/core/modules/system/src/Tests/Common/FormatDateTest.php
+++ b/core/modules/system/src/Tests/Common/FormatDateTest.php
@@ -32,7 +32,7 @@ class FormatDateTest extends WebTestBase {
   protected function setUp() {
     parent::setUp('language');
 
-    \Drupal::config('system.date')
+    $this->config('system.date')
       ->set('timezone.user.configurable', 1)
       ->save();
     $formats = $this->container->get('entity.manager')
@@ -96,7 +96,7 @@ function testFormatDate() {
     $this->assertIdentical(format_date($timestamp, 'custom', 'l, d-M-y H:i:s T', 'Europe/London', 'en'), 'Monday, 26-Mar-07 01:00:00 BST', 'Test a different time zone.');
 
     // Change the default language and timezone.
-    \Drupal::config('system.site')->set('langcode', static::LANGCODE)->save();
+    $this->config('system.site')->set('langcode', static::LANGCODE)->save();
     date_default_timezone_set('America/Los_Angeles');
 
     $this->assertIdentical(format_date($timestamp, 'custom', 'l, d-M-y H:i:s T', 'America/Los_Angeles', 'en'), 'Sunday, 25-Mar-07 17:00:00 PDT', 'Test a different language.');
diff --git a/core/modules/system/src/Tests/Condition/CurrentThemeConditionTest.php b/core/modules/system/src/Tests/Condition/CurrentThemeConditionTest.php
index bef6889..60b7281 100644
--- a/core/modules/system/src/Tests/Condition/CurrentThemeConditionTest.php
+++ b/core/modules/system/src/Tests/Condition/CurrentThemeConditionTest.php
@@ -44,7 +44,7 @@ public function testCurrentTheme() {
     $this->assertTrue($condition_negated->execute());
 
     // Set the expected theme to be used.
-    \Drupal::config('system.theme')->set('default', 'test_theme')->save();
+    $this->config('system.theme')->set('default', 'test_theme')->save();
     \Drupal::theme()->resetActiveTheme();
 
     $this->assertTrue($condition->execute());
diff --git a/core/modules/system/src/Tests/Datetime/DrupalDateTimeTest.php b/core/modules/system/src/Tests/Datetime/DrupalDateTimeTest.php
index a3f3a64..29fec17 100644
--- a/core/modules/system/src/Tests/Datetime/DrupalDateTimeTest.php
+++ b/core/modules/system/src/Tests/Datetime/DrupalDateTimeTest.php
@@ -56,7 +56,7 @@ public function testDateTimezone() {
     $date_string = '2007-01-31 21:00:00';
 
     // Make sure no site timezone has been set.
-    \Drupal::config('system.date')
+    $this->config('system.date')
       ->set('timezone.user.configurable', 0)
       ->set('timezone.default', NULL)
       ->save();
@@ -76,7 +76,7 @@ public function testDateTimezone() {
     $this->assertTrue($timezone == 'America/Yellowknife', 'DrupalDateTime uses the specified timezone if provided.');
 
     // Set a site timezone.
-    \Drupal::config('system.date')->set('timezone.default', 'Europe/Warsaw')->save();
+    $this->config('system.date')->set('timezone.default', 'Europe/Warsaw')->save();
 
     // Create a date object with an unspecified timezone, which should
     // end up using the site timezone.
@@ -85,7 +85,7 @@ public function testDateTimezone() {
     $this->assertTrue($timezone == 'Europe/Warsaw', 'DrupalDateTime uses the site timezone if provided.');
 
     // Create user.
-    \Drupal::config('system.date')->set('timezone.user.configurable', 1)->save();
+    $this->config('system.date')->set('timezone.user.configurable', 1)->save();
     $test_user = $this->drupalCreateUser(array());
     $this->drupalLogin($test_user);
 
diff --git a/core/modules/system/src/Tests/Entity/ConfigEntityImportTest.php b/core/modules/system/src/Tests/Entity/ConfigEntityImportTest.php
index c266aa4..f7036d3 100644
--- a/core/modules/system/src/Tests/Entity/ConfigEntityImportTest.php
+++ b/core/modules/system/src/Tests/Entity/ConfigEntityImportTest.php
@@ -220,7 +220,7 @@ public function assertConfigUpdateImport($name, $original_data, $custom_data) {
     $this->container->get('config.storage.staging')->write($name, $custom_data);
 
     // Verify the active configuration still returns the default values.
-    $config = $this->container->get('config.factory')->get($name);
+    $config = $this->config($name);
     $this->assertIdentical($config->get(), $original_data);
 
     // Import.
@@ -228,7 +228,7 @@ public function assertConfigUpdateImport($name, $original_data, $custom_data) {
 
     // Verify the values were updated.
     $this->container->get('config.factory')->reset($name);
-    $config = $this->container->get('config.factory')->get($name);
+    $config = $this->config($name);
     $this->assertIdentical($config->get(), $custom_data);
   }
 
diff --git a/core/modules/system/src/Tests/Extension/ThemeHandlerTest.php b/core/modules/system/src/Tests/Extension/ThemeHandlerTest.php
index 50d299c..165c52f 100644
--- a/core/modules/system/src/Tests/Extension/ThemeHandlerTest.php
+++ b/core/modules/system/src/Tests/Extension/ThemeHandlerTest.php
@@ -368,18 +368,6 @@ protected function extensionConfig() {
   }
 
   /**
-   * Returns a given config object.
-   *
-   * @param string $name
-   *   The name of the config object to load.
-   *
-   * @return \Drupal\Core\Config\Config
-   */
-  protected function config($name) {
-    return $this->container->get('config.factory')->get($name);
-  }
-
-  /**
    * Returns the active configuration storage.
    *
    * @return \Drupal\Core\Config\ConfigStorageInterface
diff --git a/core/modules/system/src/Tests/File/DirectoryTest.php b/core/modules/system/src/Tests/File/DirectoryTest.php
index 158be71..acbea60 100644
--- a/core/modules/system/src/Tests/File/DirectoryTest.php
+++ b/core/modules/system/src/Tests/File/DirectoryTest.php
@@ -155,7 +155,7 @@ function testFileDestination() {
    */
   function testFileDirectoryTemp() {
     // Start with an empty variable to ensure we have a clean slate.
-    $config = \Drupal::config('system.file');
+    $config = $this->config('system.file');
     $config->set('path.temporary', '')->save();
     $tmp_directory = file_directory_temp();
     $this->assertEqual(empty($tmp_directory), FALSE, 'file_directory_temp() returned a non-empty value.');
diff --git a/core/modules/system/src/Tests/File/NameMungingTest.php b/core/modules/system/src/Tests/File/NameMungingTest.php
index bd6a1d9..06f44c8 100644
--- a/core/modules/system/src/Tests/File/NameMungingTest.php
+++ b/core/modules/system/src/Tests/File/NameMungingTest.php
@@ -41,7 +41,7 @@ protected function setUp() {
    */
   function testMunging() {
     // Disable insecure uploads.
-    \Drupal::config('system.file')->set('allow_insecure_uploads', 0)->save();
+    $this->config('system.file')->set('allow_insecure_uploads', 0)->save();
     $munged_name = file_munge_filename($this->name, '', TRUE);
     $messages = drupal_get_messages();
     $this->assertTrue(in_array(t('For security reasons, your upload has been renamed to %filename.', array('%filename' => $munged_name)), $messages['status']), 'Alert properly set when a file is renamed.');
@@ -62,7 +62,7 @@ function testMungeNullByte() {
    * come out untouched, no matter how evil the filename.
    */
   function testMungeIgnoreInsecure() {
-    \Drupal::config('system.file')->set('allow_insecure_uploads', 1)->save();
+    $this->config('system.file')->set('allow_insecure_uploads', 1)->save();
     $munged_name = file_munge_filename($this->name, '');
     $this->assertIdentical($munged_name, $this->name, format_string('The original filename (%original) matches the munged filename (%munged) when insecure uploads are enabled.', array('%munged' => $munged_name, '%original' => $this->name)));
   }
diff --git a/core/modules/system/src/Tests/File/RemoteFileDirectoryTest.php b/core/modules/system/src/Tests/File/RemoteFileDirectoryTest.php
index 7f9d912..d8c97a3 100644
--- a/core/modules/system/src/Tests/File/RemoteFileDirectoryTest.php
+++ b/core/modules/system/src/Tests/File/RemoteFileDirectoryTest.php
@@ -37,6 +37,6 @@ class RemoteFileDirectoryTest extends DirectoryTest {
 
   protected function setUp() {
     parent::setUp();
-    \Drupal::config('system.file')->set('default_scheme', 'dummy-remote')->save();
+    $this->config('system.file')->set('default_scheme', 'dummy-remote')->save();
   }
 }
diff --git a/core/modules/system/src/Tests/File/RemoteFileScanDirectoryTest.php b/core/modules/system/src/Tests/File/RemoteFileScanDirectoryTest.php
index cc57f90..3e76a2d 100644
--- a/core/modules/system/src/Tests/File/RemoteFileScanDirectoryTest.php
+++ b/core/modules/system/src/Tests/File/RemoteFileScanDirectoryTest.php
@@ -37,6 +37,6 @@ class RemoteFileScanDirectoryTest extends ScanDirectoryTest {
 
   protected function setUp() {
     parent::setUp();
-    \Drupal::config('system.file')->set('default_scheme', 'dummy-remote')->save();
+    $this->config('system.file')->set('default_scheme', 'dummy-remote')->save();
   }
 }
diff --git a/core/modules/system/src/Tests/File/RemoteFileUnmanagedCopyTest.php b/core/modules/system/src/Tests/File/RemoteFileUnmanagedCopyTest.php
index 402196e..df8d00f 100644
--- a/core/modules/system/src/Tests/File/RemoteFileUnmanagedCopyTest.php
+++ b/core/modules/system/src/Tests/File/RemoteFileUnmanagedCopyTest.php
@@ -37,6 +37,6 @@ class RemoteFileUnmanagedCopyTest extends UnmanagedCopyTest {
 
   protected function setUp() {
     parent::setUp();
-    \Drupal::config('system.file')->set('default_scheme', 'dummy-remote')->save();
+    $this->config('system.file')->set('default_scheme', 'dummy-remote')->save();
   }
 }
diff --git a/core/modules/system/src/Tests/File/RemoteFileUnmanagedDeleteRecursiveTest.php b/core/modules/system/src/Tests/File/RemoteFileUnmanagedDeleteRecursiveTest.php
index c6bc982..b339658 100644
--- a/core/modules/system/src/Tests/File/RemoteFileUnmanagedDeleteRecursiveTest.php
+++ b/core/modules/system/src/Tests/File/RemoteFileUnmanagedDeleteRecursiveTest.php
@@ -37,6 +37,6 @@ class RemoteFileUnmanagedDeleteRecursiveTest extends UnmanagedDeleteRecursiveTes
 
   protected function setUp() {
     parent::setUp();
-    \Drupal::config('system.file')->set('default_scheme', 'dummy-remote')->save();
+    $this->config('system.file')->set('default_scheme', 'dummy-remote')->save();
   }
 }
diff --git a/core/modules/system/src/Tests/File/RemoteFileUnmanagedDeleteTest.php b/core/modules/system/src/Tests/File/RemoteFileUnmanagedDeleteTest.php
index 1cfcd92..15c1cc7 100644
--- a/core/modules/system/src/Tests/File/RemoteFileUnmanagedDeleteTest.php
+++ b/core/modules/system/src/Tests/File/RemoteFileUnmanagedDeleteTest.php
@@ -37,6 +37,6 @@ class RemoteFileUnmanagedDeleteTest extends UnmanagedDeleteTest {
 
   protected function setUp() {
     parent::setUp();
-    \Drupal::config('system.file')->set('default_scheme', 'dummy-remote')->save();
+    $this->config('system.file')->set('default_scheme', 'dummy-remote')->save();
   }
 }
diff --git a/core/modules/system/src/Tests/File/RemoteFileUnmanagedMoveTest.php b/core/modules/system/src/Tests/File/RemoteFileUnmanagedMoveTest.php
index ae495b9..3bee1e4 100644
--- a/core/modules/system/src/Tests/File/RemoteFileUnmanagedMoveTest.php
+++ b/core/modules/system/src/Tests/File/RemoteFileUnmanagedMoveTest.php
@@ -37,6 +37,6 @@ class RemoteFileUnmanagedMoveTest extends UnmanagedMoveTest {
 
   protected function setUp() {
     parent::setUp();
-    \Drupal::config('system.file')->set('default_scheme', 'dummy-remote')->save();
+    $this->config('system.file')->set('default_scheme', 'dummy-remote')->save();
   }
 }
diff --git a/core/modules/system/src/Tests/File/RemoteFileUnmanagedSaveDataTest.php b/core/modules/system/src/Tests/File/RemoteFileUnmanagedSaveDataTest.php
index 73ebf4e..fad2b5f 100644
--- a/core/modules/system/src/Tests/File/RemoteFileUnmanagedSaveDataTest.php
+++ b/core/modules/system/src/Tests/File/RemoteFileUnmanagedSaveDataTest.php
@@ -37,6 +37,6 @@ class RemoteFileUnmanagedSaveDataTest extends UnmanagedSaveDataTest {
 
   protected function setUp() {
     parent::setUp();
-    \Drupal::config('system.file')->set('default_scheme', 'dummy-remote')->save();
+    $this->config('system.file')->set('default_scheme', 'dummy-remote')->save();
   }
 }
diff --git a/core/modules/system/src/Tests/File/StreamWrapperTest.php b/core/modules/system/src/Tests/File/StreamWrapperTest.php
index e678f90..c32c82e 100644
--- a/core/modules/system/src/Tests/File/StreamWrapperTest.php
+++ b/core/modules/system/src/Tests/File/StreamWrapperTest.php
@@ -62,7 +62,7 @@ function testGetInstanceByScheme() {
    * Test the URI and target functions.
    */
   function testUriFunctions() {
-    $config = \Drupal::config('system.file');
+    $config = $this->config('system.file');
 
     $instance = file_stream_wrapper_get_instance_by_uri($this->scheme . '://foo');
     $this->assertEqual($this->classname, get_class($instance), 'Got correct class type for dummy URI.');
diff --git a/core/modules/system/src/Tests/Form/ConfirmFormTest.php b/core/modules/system/src/Tests/Form/ConfirmFormTest.php
index fcb4e61..ffcc44a 100644
--- a/core/modules/system/src/Tests/Form/ConfirmFormTest.php
+++ b/core/modules/system/src/Tests/Form/ConfirmFormTest.php
@@ -26,7 +26,7 @@ class ConfirmFormTest extends WebTestBase {
   function testConfirmForm() {
     // Test the building of the form.
     $this->drupalGet('form-test/confirm-form');
-    $site_name = $this->container->get('config.factory')->get('system.site')->get('name');
+    $site_name = $this->config('system.site')->get('name');
     $this->assertTitle(t('ConfirmFormTestForm::getQuestion(). | @site-name', array('@site-name' => $site_name)), 'The question was found as the page title.');
     $this->assertText(t('ConfirmFormTestForm::getDescription().'), 'The description was used.');
     $this->assertFieldByXPath('//input[@id="edit-submit"]', t('ConfirmFormTestForm::getConfirmText().'), 'The confirm text was used.');
diff --git a/core/modules/system/src/Tests/Form/FormStoragePageCacheTest.php b/core/modules/system/src/Tests/Form/FormStoragePageCacheTest.php
index 1838956..d04be90 100644
--- a/core/modules/system/src/Tests/Form/FormStoragePageCacheTest.php
+++ b/core/modules/system/src/Tests/Form/FormStoragePageCacheTest.php
@@ -27,7 +27,7 @@ class FormStoragePageCacheTest extends WebTestBase {
   protected function setUp() {
     parent::setUp();
 
-    $config = \Drupal::config('system.performance');
+    $config = $this->config('system.performance');
     $config->set('cache.page.use_internal', 1);
     $config->set('cache.page.max_age', 300);
     $config->save();
diff --git a/core/modules/system/src/Tests/Image/ToolkitSetupFormTest.php b/core/modules/system/src/Tests/Image/ToolkitSetupFormTest.php
index 4b19ae2..1317040 100644
--- a/core/modules/system/src/Tests/Image/ToolkitSetupFormTest.php
+++ b/core/modules/system/src/Tests/Image/ToolkitSetupFormTest.php
@@ -54,12 +54,12 @@ function testToolkitSetupForm() {
     // Test changing the jpeg image quality.
     $edit = array('gd[image_jpeg_quality]' => '70');
     $this->drupalPostForm(NULL, $edit, 'Save configuration');
-    $this->assertEqual(\Drupal::config('system.image.gd')->get('jpeg_quality'), '70');
+    $this->assertEqual($this->config('system.image.gd')->get('jpeg_quality'), '70');
 
     // Test changing the toolkit.
     $edit = array('image_toolkit' => 'test');
     $this->drupalPostForm(NULL, $edit, 'Save configuration');
-    $this->assertEqual(\Drupal::config('system.image')->get('toolkit'), 'test');
+    $this->assertEqual($this->config('system.image')->get('toolkit'), 'test');
     $this->assertFieldByName('test[test_parameter]', '10');
 
     // Test changing the test toolkit parameter.
@@ -68,7 +68,7 @@ function testToolkitSetupForm() {
     $this->assertText(t('Test parameter should be different from 0.'), 'Validation error displayed.');
     $edit = array('test[test_parameter]' => '20');
     $this->drupalPostForm(NULL, $edit, 'Save configuration');
-    $this->assertEqual(\Drupal::config('system.image.test_toolkit')->get('test_parameter'), '20');
+    $this->assertEqual($this->config('system.image.test_toolkit')->get('test_parameter'), '20');
 
     // Test access without the permission 'administer site configuration'.
     $this->drupalLogin($this->drupalCreateUser(array('access administration pages')));
diff --git a/core/modules/system/src/Tests/Mail/MailTest.php b/core/modules/system/src/Tests/Mail/MailTest.php
index 6e47c6a..3603332 100644
--- a/core/modules/system/src/Tests/Mail/MailTest.php
+++ b/core/modules/system/src/Tests/Mail/MailTest.php
@@ -38,7 +38,7 @@ class MailTest extends WebTestBase {
    */
   public function testPluggableFramework() {
     // Switch mail backends.
-    \Drupal::config('system.mail')->set('interface.default', 'test_php_mail_failure')->save();
+    $this->config('system.mail')->set('interface.default', 'test_php_mail_failure')->save();
 
     // Get the default MailInterface class instance.
     $mail_backend = \Drupal::service('plugin.manager.mail')->getInstance(array('module' => 'default', 'key' => 'default'));
@@ -48,7 +48,7 @@ public function testPluggableFramework() {
     $this->assertTrue($mail_backend instanceof TestPhpMailFailure, 'Default mail interface can be swapped.');
 
     // Add a module-specific mail backend.
-    \Drupal::config('system.mail')->set('interface.mymodule_testkey', 'test_mail_collector')->save();
+    $this->config('system.mail')->set('interface.mymodule_testkey', 'test_mail_collector')->save();
 
     // Get the added MailInterface class instance.
     $mail_backend = \Drupal::service('plugin.manager.mail')->getInstance(array('module' => 'mymodule', 'key' => 'testkey'));
@@ -67,7 +67,7 @@ public function testCancelMessage() {
     $language_interface = \Drupal::languageManager()->getCurrentLanguage();
 
     // Use the state system collector mail backend.
-    \Drupal::config('system.mail')->set('interface.default', 'test_mail_collector')->save();
+    $this->config('system.mail')->set('interface.default', 'test_mail_collector')->save();
     // Reset the state variable that holds sent messages.
     \Drupal::state()->set('system.test_mail_collector', array());
 
@@ -88,7 +88,7 @@ public function testFromAndReplyToHeader() {
     $language = \Drupal::languageManager()->getCurrentLanguage();
 
     // Use the state system collector mail backend.
-    \Drupal::config('system.mail')->set('interface.default', 'test_mail_collector')->save();
+    $this->config('system.mail')->set('interface.default', 'test_mail_collector')->save();
     // Reset the state variable that holds sent messages.
     \Drupal::state()->set('system.test_mail_collector', array());
     // Send an email with a reply-to address specified.
diff --git a/core/modules/system/src/Tests/Menu/BreadcrumbTest.php b/core/modules/system/src/Tests/Menu/BreadcrumbTest.php
index 6909a38..ab0950c 100644
--- a/core/modules/system/src/Tests/Menu/BreadcrumbTest.php
+++ b/core/modules/system/src/Tests/Menu/BreadcrumbTest.php
@@ -42,7 +42,7 @@ protected function setUp() {
     // displayed in the admin theme.
     $this->drupalPlaceBlock('system_menu_block:tools', array(
       'region' => 'content',
-      'theme' => \Drupal::config('system.theme')->get('admin'),
+      'theme' => $this->config('system.theme')->get('admin'),
     ));
   }
 
diff --git a/core/modules/system/src/Tests/Menu/MenuRouterTest.php b/core/modules/system/src/Tests/Menu/MenuRouterTest.php
index 7de9006..61ec849 100644
--- a/core/modules/system/src/Tests/Menu/MenuRouterTest.php
+++ b/core/modules/system/src/Tests/Menu/MenuRouterTest.php
@@ -208,7 +208,7 @@ protected function doTestExoticPath() {
   public function testMaintenanceModeLoginPaths() {
     $this->container->get('state')->set('system.maintenance_mode', TRUE);
 
-    $offline_message = t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => \Drupal::config('system.site')->get('name')));
+    $offline_message = t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => $this->config('system.site')->get('name')));
     $this->drupalGet('test-page');
     $this->assertText($offline_message);
     $this->drupalGet('menu_login_callback');
@@ -243,7 +243,7 @@ public function testThemeIntegration() {
 
     $theme_handler = $this->container->get('theme_handler');
     $theme_handler->install(array($this->default_theme, $this->admin_theme));
-    $this->container->get('config.factory')->get('system.theme')
+    $this->config('system.theme')
       ->set('default', $this->default_theme)
       ->set('admin', $this->admin_theme)
       ->save();
diff --git a/core/modules/system/src/Tests/Module/DependencyTest.php b/core/modules/system/src/Tests/Module/DependencyTest.php
index 6454baf..e5787a5 100644
--- a/core/modules/system/src/Tests/Module/DependencyTest.php
+++ b/core/modules/system/src/Tests/Module/DependencyTest.php
@@ -156,7 +156,7 @@ function testUninstallDependents() {
     $this->assert(count($checkbox) == 0, 'Checkbox for uninstalling the comment module not found.');
 
     // Delete any forum terms.
-    $vid = \Drupal::config('forum.settings')->get('vocabulary');
+    $vid = $this->config('forum.settings')->get('vocabulary');
     // Ensure taxonomy has been loaded into the test-runner after forum was
     // enabled.
     \Drupal::moduleHandler()->load('taxonomy');
diff --git a/core/modules/system/src/Tests/Module/InstallTest.php b/core/modules/system/src/Tests/Module/InstallTest.php
index df1dcb0..1068b60 100644
--- a/core/modules/system/src/Tests/Module/InstallTest.php
+++ b/core/modules/system/src/Tests/Module/InstallTest.php
@@ -42,7 +42,7 @@ public function testGetSchemaAtInstallTime() {
    */
   public function testEnableUserTwice() {
     \Drupal::service('module_installer')->install(array('user'), FALSE);
-    $this->assertIdentical(\Drupal::config('core.extension')->get('module.user'), 0);
+    $this->assertIdentical($this->config('core.extension')->get('module.user'), 0);
   }
 
   /**
diff --git a/core/modules/system/src/Tests/Module/InstallUninstallTest.php b/core/modules/system/src/Tests/Module/InstallUninstallTest.php
index 66db3e0..125b754 100644
--- a/core/modules/system/src/Tests/Module/InstallUninstallTest.php
+++ b/core/modules/system/src/Tests/Module/InstallUninstallTest.php
@@ -156,7 +156,7 @@ protected function assertSuccessfullUninstall($module, $package = 'Core') {
     if ($module == 'forum') {
       // Forum cannot be uninstalled until all of the content entities related
       // to it have been deleted.
-      $vid = \Drupal::config('forum.settings')->get('vocabulary');
+      $vid = $this->config('forum.settings')->get('vocabulary');
       $terms = entity_load_multiple_by_properties('taxonomy_term', ['vid' => $vid]);
       foreach ($terms as $term) {
         $term->delete();
diff --git a/core/modules/system/src/Tests/Module/ModuleTestBase.php b/core/modules/system/src/Tests/Module/ModuleTestBase.php
index e3476df..4023b57 100644
--- a/core/modules/system/src/Tests/Module/ModuleTestBase.php
+++ b/core/modules/system/src/Tests/Module/ModuleTestBase.php
@@ -120,7 +120,7 @@ function assertModuleConfig($module) {
     // list all default config once more, but filtered by $module.
     $names = $module_file_storage->listAll($module . '.');
     foreach ($names as $key => $name) {
-      if (\Drupal::config($name)->get()) {
+      if ($this->config($name)->get()) {
         unset($names[$key]);
       }
     }
diff --git a/core/modules/system/src/Tests/Path/UrlAlterFunctionalTest.php b/core/modules/system/src/Tests/Path/UrlAlterFunctionalTest.php
index 56728c1..7260169 100644
--- a/core/modules/system/src/Tests/Path/UrlAlterFunctionalTest.php
+++ b/core/modules/system/src/Tests/Path/UrlAlterFunctionalTest.php
@@ -62,7 +62,7 @@ function testUrlAlter() {
     $this->drupalGet('community');
     $this->assertText('General discussion', 'The community path gets resolved correctly');
     $this->assertUrlOutboundAlter('forum', 'community');
-    $forum_vid = \Drupal::config('forum.settings')->get('vocabulary');
+    $forum_vid = $this->config('forum.settings')->get('vocabulary');
     $term_name = $this->randomMachineName();
     $term = entity_create('taxonomy_term', array(
       'name' => $term_name,
diff --git a/core/modules/system/src/Tests/Routing/ExceptionHandlingTest.php b/core/modules/system/src/Tests/Routing/ExceptionHandlingTest.php
index 15a491d..052033f 100644
--- a/core/modules/system/src/Tests/Routing/ExceptionHandlingTest.php
+++ b/core/modules/system/src/Tests/Routing/ExceptionHandlingTest.php
@@ -105,7 +105,7 @@ public function testHtml404() {
    */
   public function testBacktraceEscaping() {
     // Enable verbose error logging.
-    \Drupal::config('system.logging')->set('error_level', ERROR_REPORTING_DISPLAY_VERBOSE)->save();
+    $this->config('system.logging')->set('error_level', ERROR_REPORTING_DISPLAY_VERBOSE)->save();
 
     $request = Request::create('/router_test/test17');
     $request->headers->set('Accept', 'text/html');
diff --git a/core/modules/system/src/Tests/Session/SessionTest.php b/core/modules/system/src/Tests/Session/SessionTest.php
index ae7fa8d..7e9c16a 100644
--- a/core/modules/system/src/Tests/Session/SessionTest.php
+++ b/core/modules/system/src/Tests/Session/SessionTest.php
@@ -144,7 +144,7 @@ function testEmptyAnonymousSession() {
     $this->assertSessionEmpty(TRUE);
 
     // The same behavior is expected when caching is enabled.
-    $config = \Drupal::config('system.performance');
+    $config = $this->config('system.performance');
     $config->set('cache.page.use_internal', 1);
     $config->set('cache.page.max_age', 300);
     $config->save();
diff --git a/core/modules/system/src/Tests/System/AccessDeniedTest.php b/core/modules/system/src/Tests/System/AccessDeniedTest.php
index a492c91..f19f821 100644
--- a/core/modules/system/src/Tests/System/AccessDeniedTest.php
+++ b/core/modules/system/src/Tests/System/AccessDeniedTest.php
@@ -72,7 +72,7 @@ function testAccessDenied() {
 
     // Log back in, set the custom 403 page to /user/login and remove the block
     $this->drupalLogin($this->admin_user);
-    \Drupal::config('system.site')->set('page.403', 'user/login')->save();
+    $this->config('system.site')->set('page.403', 'user/login')->save();
     $edit = array(
       'region' => -1,
     );
diff --git a/core/modules/system/src/Tests/System/CronRunTest.php b/core/modules/system/src/Tests/System/CronRunTest.php
index 3f3fdef..a7fde1c 100644
--- a/core/modules/system/src/Tests/System/CronRunTest.php
+++ b/core/modules/system/src/Tests/System/CronRunTest.php
@@ -54,7 +54,7 @@ function testAutomaticCron() {
     $cron_last = time();
     $cron_safe_threshold = 100;
     \Drupal::state()->set('system.cron_last', $cron_last);
-    \Drupal::config('system.cron')
+    $this->config('system.cron')
       ->set('threshold.autorun', $cron_safe_threshold)
       ->save();
     $this->drupalGet('');
diff --git a/core/modules/system/src/Tests/System/DateTimeTest.php b/core/modules/system/src/Tests/System/DateTimeTest.php
index 2e2e4ed..fa87fc9 100644
--- a/core/modules/system/src/Tests/System/DateTimeTest.php
+++ b/core/modules/system/src/Tests/System/DateTimeTest.php
@@ -37,7 +37,7 @@ protected function setUp() {
    */
   function testTimeZoneHandling() {
     // Setup date/time settings for Honolulu time.
-    $config = \Drupal::config('system.date')
+    $config = $this->config('system.date')
       ->set('timezone.default', 'Pacific/Honolulu')
       ->set('timezone.user.configurable', 0)
       ->save();
diff --git a/core/modules/system/src/Tests/System/ErrorHandlerTest.php b/core/modules/system/src/Tests/System/ErrorHandlerTest.php
index c99d8fa..597a374 100644
--- a/core/modules/system/src/Tests/System/ErrorHandlerTest.php
+++ b/core/modules/system/src/Tests/System/ErrorHandlerTest.php
@@ -27,7 +27,7 @@ class ErrorHandlerTest extends WebTestBase {
    * Test the error handler.
    */
   function testErrorHandler() {
-    $config = \Drupal::config('system.logging');
+    $config = $this->config('system.logging');
     $error_notice = array(
       '%type' => 'Notice',
       '!message' => 'Undefined variable: bananas',
@@ -48,7 +48,7 @@ function testErrorHandler() {
     );
 
     // Set error reporting to display verbose notices.
-    \Drupal::config('system.logging')->set('error_level', ERROR_REPORTING_DISPLAY_VERBOSE)->save();
+    $this->config('system.logging')->set('error_level', ERROR_REPORTING_DISPLAY_VERBOSE)->save();
     $this->drupalGet('error-test/generate-warnings');
     $this->assertResponse(200, 'Received expected HTTP status code.');
     $this->assertErrorMessage($error_notice);
diff --git a/core/modules/system/src/Tests/System/FrontPageTest.php b/core/modules/system/src/Tests/System/FrontPageTest.php
index dd24ef5..0b9d759 100644
--- a/core/modules/system/src/Tests/System/FrontPageTest.php
+++ b/core/modules/system/src/Tests/System/FrontPageTest.php
@@ -33,7 +33,7 @@ protected function setUp() {
     $this->node_path = "node/" . $this->drupalCreateNode(array('promote' => 1))->id();
 
     // Configure 'node' as front page.
-    \Drupal::config('system.site')->set('page.front', 'node')->save();
+    $this->config('system.site')->set('page.front', 'node')->save();
     // Enable front page logging in system_test.module.
     \Drupal::state()->set('system_test.front_page_output', 1);
   }
diff --git a/core/modules/system/src/Tests/System/SiteMaintenanceTest.php b/core/modules/system/src/Tests/System/SiteMaintenanceTest.php
index df33c9b..e185550 100644
--- a/core/modules/system/src/Tests/System/SiteMaintenanceTest.php
+++ b/core/modules/system/src/Tests/System/SiteMaintenanceTest.php
@@ -29,7 +29,7 @@ protected function setUp() {
     parent::setUp();
 
     // Configure 'node' as front page.
-    \Drupal::config('system.site')->set('page.front', 'node')->save();
+    $this->config('system.site')->set('page.front', 'node')->save();
 
     // Create a user allowed to access site in maintenance mode.
     $this->user = $this->drupalCreateUser(array('access site in maintenance mode'));
@@ -50,7 +50,7 @@ function testSiteMaintenance() {
 
     $admin_message = t('Operating in maintenance mode. <a href="@url">Go online.</a>', array('@url' => \Drupal::url('system.site_maintenance_mode')));
     $user_message = t('Operating in maintenance mode.');
-    $offline_message = t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => \Drupal::config('system.site')->get('name')));
+    $offline_message = t('@site is currently under maintenance. We should be back shortly. Thank you for your patience.', array('@site' => $this->config('system.site')->get('name')));
 
     $this->drupalGet('');
     $this->assertRaw($admin_message, 'Found the site maintenance mode message.');
diff --git a/core/modules/system/src/Tests/System/SystemConfigFormTestBase.php b/core/modules/system/src/Tests/System/SystemConfigFormTestBase.php
index a9f17c0..8aa38aa 100644
--- a/core/modules/system/src/Tests/System/SystemConfigFormTestBase.php
+++ b/core/modules/system/src/Tests/System/SystemConfigFormTestBase.php
@@ -65,7 +65,7 @@ public function testConfigForm() {
     $this->assertTrue($valid_form, format_string('Input values: %values<br/>Validation handler errors: %errors', $args));
 
     foreach ($this->values as $data) {
-      $this->assertEqual($data['#value'], \Drupal::config($data['#config_name'])->get($data['#config_key']));
+      $this->assertEqual($data['#value'], $this->config($data['#config_name'])->get($data['#config_key']));
     }
   }
 }
diff --git a/core/modules/system/src/Tests/System/ThemeTest.php b/core/modules/system/src/Tests/System/ThemeTest.php
index 80d469a..def8de6 100644
--- a/core/modules/system/src/Tests/System/ThemeTest.php
+++ b/core/modules/system/src/Tests/System/ThemeTest.php
@@ -242,7 +242,7 @@ function testSwitchDefaultTheme() {
     \Drupal::service('theme_handler')->install(array('bartik'));
     $this->drupalGet('admin/appearance');
     $this->clickLink(t('Set as default'));
-    $this->assertEqual(\Drupal::config('system.theme')->get('default'), 'bartik');
+    $this->assertEqual($this->config('system.theme')->get('default'), 'bartik');
 
     // Test the default theme on the secondary links (blocks admin page).
     $this->drupalGet('admin/structure/block');
diff --git a/core/modules/system/src/Tests/System/TokenReplaceUnitTest.php b/core/modules/system/src/Tests/System/TokenReplaceUnitTest.php
index c512364..9a51f2f 100644
--- a/core/modules/system/src/Tests/System/TokenReplaceUnitTest.php
+++ b/core/modules/system/src/Tests/System/TokenReplaceUnitTest.php
@@ -60,7 +60,7 @@ public function testClear() {
     $source .= '[bogus:token]';
 
     // Replace with with the clear parameter, only the valid token should remain.
-    $target = String::checkPlain(\Drupal::config('system.site')->get('name'));
+    $target = String::checkPlain($this->config('system.site')->get('name'));
     $result = $this->tokenService->replace($source, array(), array('langcode' => $this->interfaceLanguage->getId(), 'clear' => TRUE));
     $this->assertEqual($target, $result, 'Valid tokens replaced while invalid tokens ignored.');
 
@@ -85,7 +85,7 @@ public function testSystemSiteTokenReplacement() {
     $safe_slogan = Xss::filterAdmin($slogan);
 
     // Set a few site variables.
-    $config = $this->container->get('config.factory')->get('system.site');
+    $config = $this->config('system.site');
     $config
       ->set('name', '<strong>Drupal<strong>')
       ->set('slogan', $slogan)
diff --git a/core/modules/system/src/Tests/Theme/EnginePhpTemplateTest.php b/core/modules/system/src/Tests/Theme/EnginePhpTemplateTest.php
index 8cbde63..1707814 100644
--- a/core/modules/system/src/Tests/Theme/EnginePhpTemplateTest.php
+++ b/core/modules/system/src/Tests/Theme/EnginePhpTemplateTest.php
@@ -32,7 +32,7 @@ protected function setUp() {
    * Ensures a theme's template is overrideable based on the 'template' filename.
    */
   function testTemplateOverride() {
-    \Drupal::config('system.theme')
+    $this->config('system.theme')
       ->set('default', 'test_theme_phptemplate')
       ->save();
     $this->drupalGet('theme-test/template-test');
diff --git a/core/modules/system/src/Tests/Theme/EngineTwigTest.php b/core/modules/system/src/Tests/Theme/EngineTwigTest.php
index acfd1d1..91c84a7 100644
--- a/core/modules/system/src/Tests/Theme/EngineTwigTest.php
+++ b/core/modules/system/src/Tests/Theme/EngineTwigTest.php
@@ -33,7 +33,7 @@ protected function setUp() {
    * Tests that the Twig engine handles PHP data correctly.
    */
   function testTwigVariableDataTypes() {
-    \Drupal::config('system.theme')
+    $this->config('system.theme')
       ->set('default', 'test_theme')
       ->save();
     $this->drupalGet('twig-theme-test/php-variables');
diff --git a/core/modules/system/src/Tests/Theme/EntityFilteringThemeTest.php b/core/modules/system/src/Tests/Theme/EntityFilteringThemeTest.php
index 001f65b..8360cd4 100644
--- a/core/modules/system/src/Tests/Theme/EntityFilteringThemeTest.php
+++ b/core/modules/system/src/Tests/Theme/EntityFilteringThemeTest.php
@@ -132,7 +132,7 @@ function testThemedEntity() {
 
     // Check each path in all available themes.
     foreach ($this->themes as $name => $theme) {
-      \Drupal::config('system.theme')
+      $this->config('system.theme')
         ->set('default', $name)
         ->save();
       foreach ($paths as $path) {
diff --git a/core/modules/system/src/Tests/Theme/ThemeInfoTest.php b/core/modules/system/src/Tests/Theme/ThemeInfoTest.php
index b8438bc..aeb8846 100644
--- a/core/modules/system/src/Tests/Theme/ThemeInfoTest.php
+++ b/core/modules/system/src/Tests/Theme/ThemeInfoTest.php
@@ -60,7 +60,7 @@ protected function setUp() {
    */
   function testStylesheets() {
     $this->themeHandler->install(array('test_basetheme', 'test_subtheme'));
-    \Drupal::config('system.theme')
+    $this->config('system.theme')
       ->set('default', 'test_subtheme')
       ->save();
 
diff --git a/core/modules/system/src/Tests/Theme/ThemeSuggestionsAlterTest.php b/core/modules/system/src/Tests/Theme/ThemeSuggestionsAlterTest.php
index 5ac8bed..bd5f6e9 100644
--- a/core/modules/system/src/Tests/Theme/ThemeSuggestionsAlterTest.php
+++ b/core/modules/system/src/Tests/Theme/ThemeSuggestionsAlterTest.php
@@ -38,7 +38,7 @@ function testTemplateSuggestions() {
 
     // Install test_theme, it contains a template suggested by theme_test.module
     // in theme_test_theme_suggestions_theme_test_suggestion_provided().
-    \Drupal::config('system.theme')
+    $this->config('system.theme')
       ->set('default', 'test_theme')
       ->save();
 
@@ -54,7 +54,7 @@ function testGeneralSuggestionsAlter() {
     $this->assertText('Original template for testing hook_theme_suggestions_alter().');
 
     // Install test_theme and test that themes can alter template suggestions.
-    \Drupal::config('system.theme')
+    $this->config('system.theme')
       ->set('default', 'test_theme')
       ->save();
     $this->drupalGet('theme-test/general-suggestion-alter');
@@ -76,7 +76,7 @@ function testTemplateSuggestionsAlter() {
     $this->assertText('Original template for testing hook_theme_suggestions_HOOK_alter().');
 
     // Install test_theme and test that themes can alter template suggestions.
-    \Drupal::config('system.theme')
+    $this->config('system.theme')
       ->set('default', 'test_theme')
       ->save();
     $this->drupalGet('theme-test/suggestion-alter');
@@ -98,7 +98,7 @@ function testSpecificSuggestionsAlter() {
     $this->drupalGet('theme-test/specific-suggestion-alter');
     $this->assertText('Template for testing specific theme calls.');
 
-    \Drupal::config('system.theme')
+    $this->config('system.theme')
       ->set('default', 'test_theme')
       ->save();
 
@@ -123,7 +123,7 @@ function testThemeFunctionSuggestionsAlter() {
     $this->assertText('Original theme function.');
 
     // Install test_theme and test that themes can alter theme suggestions.
-    \Drupal::config('system.theme')
+    $this->config('system.theme')
       ->set('default', 'test_theme')
       ->save();
     $this->drupalGet('theme-test/function-suggestion-alter');
@@ -164,7 +164,7 @@ public function testSuggestionsAlterInclude() {
    */
   function testExecutionOrder() {
     // Install our test theme and module.
-    \Drupal::config('system.theme')
+    $this->config('system.theme')
       ->set('default', 'test_theme')
       ->save();
     \Drupal::service('module_installer')->install(array('theme_suggestions_test'));
diff --git a/core/modules/system/src/Tests/Theme/ThemeTest.php b/core/modules/system/src/Tests/Theme/ThemeTest.php
index ed46e53..129c8b3 100644
--- a/core/modules/system/src/Tests/Theme/ThemeTest.php
+++ b/core/modules/system/src/Tests/Theme/ThemeTest.php
@@ -79,7 +79,7 @@ function testThemeDataTypes() {
   function testThemeSuggestions() {
     // Set the front page as something random otherwise the CLI
     // test runner fails.
-    \Drupal::config('system.site')->set('page.front', 'nobody-home')->save();
+    $this->config('system.site')->set('page.front', 'nobody-home')->save();
     $args = array('node', '1', 'edit');
     $suggestions = theme_get_suggestions($args, 'page');
     $this->assertEqual($suggestions, array('page__node', 'page__node__%', 'page__node__1', 'page__node__edit'), 'Found expected node edit page suggestions');
@@ -146,7 +146,7 @@ function testFrontPageThemeSuggestion() {
     $request->attributes->set(RouteObjectInterface::ROUTE_NAME, 'user.login');
     $request->attributes->set(RouteObjectInterface::ROUTE_OBJECT, new Route('/user/login'));
     \Drupal::requestStack()->push($request);
-    \Drupal::config('system.site')->set('page.front', 'user/login')->save();
+    $this->config('system.site')->set('page.front', 'user/login')->save();
     $suggestions = theme_get_suggestions(array('user', 'login'), 'page');
     // Set it back to not annoy the batch runner.
     \Drupal::requestStack()->pop();
@@ -163,7 +163,7 @@ function testCSSOverride() {
     // what is output to the HTML HEAD based on what is in a theme's .info.yml
     // file, so it doesn't matter what page we get, as long as it is themed with
     // the test theme. First we test with CSS aggregation disabled.
-    $config = \Drupal::config('system.performance');
+    $config = $this->config('system.performance');
     $config->set('css.preprocess', 0);
     $config->save();
     $this->drupalGet('theme-test/suggestion');
@@ -184,7 +184,7 @@ function testCSSOverride() {
    * Ensures a themes template is overrideable based on the 'template' filename.
    */
   function testTemplateOverride() {
-    \Drupal::config('system.theme')
+    $this->config('system.theme')
       ->set('default', 'test_theme')
       ->save();
     $this->drupalGet('theme-test/template-test');
diff --git a/core/modules/system/src/Tests/Theme/TwigDebugMarkupTest.php b/core/modules/system/src/Tests/Theme/TwigDebugMarkupTest.php
index 0872f5c..4b6d528 100644
--- a/core/modules/system/src/Tests/Theme/TwigDebugMarkupTest.php
+++ b/core/modules/system/src/Tests/Theme/TwigDebugMarkupTest.php
@@ -29,7 +29,7 @@ class TwigDebugMarkupTest extends WebTestBase {
   function testTwigDebugMarkup() {
     $extension = twig_extension();
     \Drupal::service('theme_handler')->install(array('test_theme'));
-    \Drupal::config('system.theme')->set('default', 'test_theme')->save();
+    $this->config('system.theme')->set('default', 'test_theme')->save();
     $this->drupalCreateContentType(array('type' => 'page'));
     // Enable debug, rebuild the service container, and clear all caches.
     $parameters = $this->container->getParameter('twig.config');
diff --git a/core/modules/system/src/Tests/Theme/TwigExtensionTest.php b/core/modules/system/src/Tests/Theme/TwigExtensionTest.php
index 66ebf47..6719ab7 100644
--- a/core/modules/system/src/Tests/Theme/TwigExtensionTest.php
+++ b/core/modules/system/src/Tests/Theme/TwigExtensionTest.php
@@ -41,7 +41,7 @@ function testTwigExtensionLoaded() {
    * Tests that the Twig extension's filter produces expected output.
    */
   function testTwigExtensionFilter() {
-    \Drupal::config('system.theme')
+    $this->config('system.theme')
       ->set('default', 'test_theme')
       ->save();
 
@@ -53,7 +53,7 @@ function testTwigExtensionFilter() {
    * Tests that the Twig extension's function produces expected output.
    */
   function testTwigExtensionFunction() {
-    \Drupal::config('system.theme')
+    $this->config('system.theme')
       ->set('default', 'test_theme')
       ->save();
 
diff --git a/core/modules/system/src/Tests/Theme/TwigTransTest.php b/core/modules/system/src/Tests/Theme/TwigTransTest.php
index 956e7be..7f21b2d 100644
--- a/core/modules/system/src/Tests/Theme/TwigTransTest.php
+++ b/core/modules/system/src/Tests/Theme/TwigTransTest.php
@@ -55,7 +55,7 @@ protected function setUp() {
 
     // Setup test_theme.
     \Drupal::service('theme_handler')->install(array('test_theme'));
-    \Drupal::config('system.theme')->set('default', 'test_theme')->save();
+    $this->config('system.theme')->set('default', 'test_theme')->save();
 
     // Create and log in as admin.
     $this->admin_user = $this->drupalCreateUser(array(
@@ -70,7 +70,7 @@ protected function setUp() {
     $this->installLanguages();
 
     // Assign Lolspeak (xx) to be the default language.
-    \Drupal::config('system.site')->set('langcode', 'xx')->save();
+    $this->config('system.site')->set('langcode', 'xx')->save();
     $this->rebuildContainer();
 
     // Check that lolspeak is the default language for the site.
diff --git a/core/modules/system/src/Tests/Update/UpdateScriptTest.php b/core/modules/system/src/Tests/Update/UpdateScriptTest.php
index 893682e..360f5a6 100644
--- a/core/modules/system/src/Tests/Update/UpdateScriptTest.php
+++ b/core/modules/system/src/Tests/Update/UpdateScriptTest.php
@@ -64,7 +64,7 @@ function testUpdateAccess() {
    * Tests that requirements warnings and errors are correctly displayed.
    */
   function testRequirements() {
-    $update_script_test_config = \Drupal::config('update_script_test.settings');
+    $update_script_test_config = $this->config('update_script_test.settings');
     $this->drupalLogin($this->update_user);
 
     // If there are no requirements warnings or errors, we expect to be able to
@@ -120,10 +120,10 @@ function testThemeSystem() {
     // Since visiting update.php triggers a rebuild of the theme system from an
     // unusual maintenance mode environment, we check that this rebuild did not
     // put any incorrect information about the themes into the database.
-    $original_theme_data = \Drupal::config('core.extension')->get('theme');
+    $original_theme_data = $this->config('core.extension')->get('theme');
     $this->drupalLogin($this->update_user);
     $this->drupalGet($this->update_url, array('external' => TRUE));
-    $final_theme_data = \Drupal::config('core.extension')->get('theme');
+    $final_theme_data = $this->config('core.extension')->get('theme');
     $this->assertEqual($original_theme_data, $final_theme_data, 'Visiting update.php does not alter the information about themes stored in the database.');
   }
 
diff --git a/core/modules/taxonomy/src/Tests/TermLanguageTest.php b/core/modules/taxonomy/src/Tests/TermLanguageTest.php
index 4096e4b..b27a1c6 100644
--- a/core/modules/taxonomy/src/Tests/TermLanguageTest.php
+++ b/core/modules/taxonomy/src/Tests/TermLanguageTest.php
@@ -96,7 +96,7 @@ function testDefaultTermLanguage() {
 
     // Change the default language of the site and check if the default terms
     // language is still correctly selected.
-    \Drupal::config('system.site')->set('langcode', 'cc')->save();
+    $this->config('system.site')->set('langcode', 'cc')->save();
     $edit = array(
       'default_language[langcode]' => LanguageInterface::LANGCODE_SITE_DEFAULT,
       'default_language[language_alterable]' => TRUE,
diff --git a/core/modules/taxonomy/src/Tests/TermTest.php b/core/modules/taxonomy/src/Tests/TermTest.php
index 72694c0..cf87ec0 100644
--- a/core/modules/taxonomy/src/Tests/TermTest.php
+++ b/core/modules/taxonomy/src/Tests/TermTest.php
@@ -104,7 +104,7 @@ function testTaxonomyTermHierarchy() {
    */
   function testTaxonomyTermChildTerms() {
     // Set limit to 10 terms per page. Set variable to 9 so 10 terms appear.
-    \Drupal::config('taxonomy.settings')->set('terms_per_page_admin', '9')->save();
+    $this->config('taxonomy.settings')->set('terms_per_page_admin', '9')->save();
     $term1 = $this->createTerm($this->vocabulary);
     $terms_array = '';
 
diff --git a/core/modules/taxonomy/src/Tests/ThemeTest.php b/core/modules/taxonomy/src/Tests/ThemeTest.php
index 9ababed..671df01 100644
--- a/core/modules/taxonomy/src/Tests/ThemeTest.php
+++ b/core/modules/taxonomy/src/Tests/ThemeTest.php
@@ -20,7 +20,7 @@ protected function setUp() {
     // Make sure we are using distinct default and administrative themes for
     // the duration of these tests.
     \Drupal::service('theme_handler')->install(array('bartik', 'seven'));
-    \Drupal::config('system.theme')
+    $this->config('system.theme')
       ->set('default', 'bartik')
       ->set('admin', 'seven')
       ->save();
diff --git a/core/modules/taxonomy/src/Tests/Views/RelationshipNodeTermDataTest.php b/core/modules/taxonomy/src/Tests/Views/RelationshipNodeTermDataTest.php
index 9208a28..eed681f 100644
--- a/core/modules/taxonomy/src/Tests/Views/RelationshipNodeTermDataTest.php
+++ b/core/modules/taxonomy/src/Tests/Views/RelationshipNodeTermDataTest.php
@@ -48,7 +48,7 @@ function testViewsHandlerRelationshipNodeTermData() {
     $this->assertIdenticalResultset($view, $expected_result, $column_map);
 
     // Change the view to test relation limited by vocabulary.
-    \Drupal::config('views.view.test_taxonomy_node_term_data')
+    $this->config('views.view.test_taxonomy_node_term_data')
       ->set('display.default.display_options.relationships.term_node_tid.vids', ['views_testing_tags'])
       ->save();
 
diff --git a/core/modules/taxonomy/src/Tests/VocabularyUiTest.php b/core/modules/taxonomy/src/Tests/VocabularyUiTest.php
index 134bb36..d9e305c 100644
--- a/core/modules/taxonomy/src/Tests/VocabularyUiTest.php
+++ b/core/modules/taxonomy/src/Tests/VocabularyUiTest.php
@@ -66,7 +66,7 @@ function testVocabularyInterface() {
     $edit['vid'] = 'don_t_panic';
     $this->drupalPostForm('admin/structure/taxonomy/add', $edit, t('Save'));
 
-    $site_name = \Drupal::config('system.site')->get('name');
+    $site_name = $this->config('system.site')->get('name');
     $this->assertTitle(t('Don\'t Panic | @site-name', array('@site-name' => $site_name)), 'The page title contains the escaped character.');
     $this->assertNoTitle(t('Don&#039;t Panic | @site-name', array('@site-name' => $site_name)), 'The page title does not contain an encoded character.');
   }
diff --git a/core/modules/tour/src/Tests/TourTestBasic.php b/core/modules/tour/src/Tests/TourTestBasic.php
index 5cf9322..160f782 100644
--- a/core/modules/tour/src/Tests/TourTestBasic.php
+++ b/core/modules/tour/src/Tests/TourTestBasic.php
@@ -50,8 +50,7 @@ protected function setUp() {
     // Make sure we are using distinct default and administrative themes for
     // the duration of these tests.
     $this->container->get('theme_handler')->install(array('bartik', 'seven'));
-    $this->container->get('config.factory')
-      ->get('system.theme')
+    $this->config('system.theme')
       ->set('default', 'bartik')
       ->set('admin', 'seven')
       ->save();
diff --git a/core/modules/tracker/src/Tests/TrackerTest.php b/core/modules/tracker/src/Tests/TrackerTest.php
index 354e842..7bcaa42 100644
--- a/core/modules/tracker/src/Tests/TrackerTest.php
+++ b/core/modules/tracker/src/Tests/TrackerTest.php
@@ -116,7 +116,7 @@ function testTrackerUser() {
     $this->assertNoLink($unpublished->label());
     // Verify that title and tab title have been set correctly.
     $this->assertText('Activity', 'The user activity tab has the name "Activity".');
-    $this->assertTitle(t('@name | @site', array('@name' => $this->user->getUsername(), '@site' => \Drupal::config('system.site')->get('name'))), 'The user tracker page has the correct page title.');
+    $this->assertTitle(t('@name | @site', array('@name' => $this->user->getUsername(), '@site' => $this->config('system.site')->get('name'))), 'The user tracker page has the correct page title.');
 
     // Verify that unpublished comments are removed from the tracker.
     $admin_user = $this->drupalCreateUser(array('post comments', 'administer comments', 'access user profiles'));
diff --git a/core/modules/update/src/Tests/UpdateContribTest.php b/core/modules/update/src/Tests/UpdateContribTest.php
index 95e2b88..a75bb32 100644
--- a/core/modules/update/src/Tests/UpdateContribTest.php
+++ b/core/modules/update/src/Tests/UpdateContribTest.php
@@ -45,7 +45,7 @@ function testNoReleasesAvailable() {
         'hidden' => FALSE,
       ),
     );
-    \Drupal::config('update_test.settings')->set('system_info', $system_info)->save();
+    $this->config('update_test.settings')->set('system_info', $system_info)->save();
     $this->refreshUpdateStatus(array('drupal' => '0.0', 'aaa_update_test' => 'no-releases'));
     $this->drupalGet('admin/reports/updates');
     // Cannot use $this->standardTests() because we need to check for the
@@ -76,7 +76,7 @@ function testUpdateContribBasic() {
         'hidden' => FALSE,
       ),
     );
-    \Drupal::config('update_test.settings')->set('system_info', $system_info)->save();
+    $this->config('update_test.settings')->set('system_info', $system_info)->save();
     $this->refreshUpdateStatus(
       array(
         'drupal' => '0.0',
@@ -135,7 +135,7 @@ function testUpdateContribOrder() {
         'hidden' => FALSE,
       ),
     );
-    \Drupal::config('update_test.settings')->set('system_info', $system_info)->save();
+    $this->config('update_test.settings')->set('system_info', $system_info)->save();
     $this->refreshUpdateStatus(array('drupal' => '0.0', '#all' => '1_0'));
     $this->standardTests();
     // We're expecting the report to say all projects are up to date.
@@ -190,7 +190,7 @@ function testUpdateBaseThemeSecurityUpdate() {
         'hidden' => FALSE,
       ),
     );
-    \Drupal::config('update_test.settings')->set('system_info', $system_info)->save();
+    $this->config('update_test.settings')->set('system_info', $system_info)->save();
     $xml_mapping = array(
       'drupal' => '0.0',
       'update_test_subtheme' => '1_0',
@@ -208,9 +208,9 @@ function testUpdateBaseThemeSecurityUpdate() {
    *   base themes have to be installed.
    */
   function testUpdateShowDisabledThemes() {
-    $update_settings = \Drupal::config('update.settings');
+    $update_settings = $this->config('update.settings');
     // Make sure all the update_test_* themes are disabled.
-    $extension_config = \Drupal::config('core.extension');
+    $extension_config = $this->config('core.extension');
     foreach ($extension_config->get('theme') as $theme => $weight) {
       if (preg_match('/^update_test_/', $theme)) {
         $extension_config->clear("theme.$theme");
@@ -242,7 +242,7 @@ function testUpdateShowDisabledThemes() {
     // of update_max_fetch_attempts. Therefore this variable is set very high
     // to avoid test failures in those cases.
     $update_settings->set('fetch.max_attempts', 99999)->save();
-    \Drupal::config('update_test.settings')->set('system_info', $system_info)->save();
+    $this->config('update_test.settings')->set('system_info', $system_info)->save();
     $xml_mapping = array(
       'drupal' => '0.0',
       'update_test_subtheme' => '1_0',
@@ -291,7 +291,7 @@ function testUpdateHiddenBaseTheme() {
         'hidden' => FALSE,
       ),
     );
-    \Drupal::config('update_test.settings')->set('system_info', $system_info)->save();
+    $this->config('update_test.settings')->set('system_info', $system_info)->save();
     $projects = update_get_projects();
     $theme_data = system_rebuild_theme_data();
     $project_info = new ProjectInfo();
@@ -324,7 +324,7 @@ function testUpdateBrokenFetchURL() {
         'hidden' => FALSE,
       ),
     );
-    \Drupal::config('update_test.settings')->set('system_info', $system_info)->save();
+    $this->config('update_test.settings')->set('system_info', $system_info)->save();
 
     $xml_mapping = array(
       'drupal' => '0.0',
@@ -365,7 +365,7 @@ function testUpdateBrokenFetchURL() {
    * update, then assert if we see the appropriate warnings on the right pages.
    */
   function testHookUpdateStatusAlter() {
-    $update_test_config = \Drupal::config('update_test.settings');
+    $update_test_config = $this->config('update_test.settings');
     $update_admin_user = $this->drupalCreateUser(array('administer site configuration', 'administer software updates'));
     $this->drupalLogin($update_admin_user);
 
diff --git a/core/modules/update/src/Tests/UpdateCoreTest.php b/core/modules/update/src/Tests/UpdateCoreTest.php
index 6d32245..9b8f058 100644
--- a/core/modules/update/src/Tests/UpdateCoreTest.php
+++ b/core/modules/update/src/Tests/UpdateCoreTest.php
@@ -42,7 +42,7 @@ protected function setSystemInfo($version) {
         'version' => $version,
       ),
     );
-    \Drupal::config('update_test.settings')->set('system_info', $setting)->save();
+    $this->config('update_test.settings')->set('system_info', $setting)->save();
   }
 
   /**
@@ -176,7 +176,7 @@ function testDatestampMismatch() {
         'datestamp' => '1000000000',
       ),
     );
-    \Drupal::config('update_test.settings')->set('system_info', $system_info)->save();
+    $this->config('update_test.settings')->set('system_info', $system_info)->save();
     $this->refreshUpdateStatus(array('drupal' => 'dev'));
     $this->assertNoText(t('2001-Sep-'));
     $this->assertText(t('Up to date'));
@@ -189,10 +189,10 @@ function testDatestampMismatch() {
    */
   function testModulePageRunCron() {
     $this->setSystemInfo('8.0.0');
-    \Drupal::config('update.settings')
+    $this->config('update.settings')
       ->set('fetch.url', _url('update-test', array('absolute' => TRUE)))
       ->save();
-    \Drupal::config('update_test.settings')
+    $this->config('update_test.settings')
       ->set('xml_map', array('drupal' => '0.0'))
       ->save();
 
@@ -207,10 +207,10 @@ function testModulePageRunCron() {
   function testModulePageUpToDate() {
     $this->setSystemInfo('8.0.0');
     // Instead of using refreshUpdateStatus(), set these manually.
-    \Drupal::config('update.settings')
+    $this->config('update.settings')
       ->set('fetch.url', _url('update-test', array('absolute' => TRUE)))
       ->save();
-    \Drupal::config('update_test.settings')
+    $this->config('update_test.settings')
       ->set('xml_map', array('drupal' => '0.0'))
       ->save();
 
@@ -228,10 +228,10 @@ function testModulePageUpToDate() {
   function testModulePageRegularUpdate() {
     $this->setSystemInfo('8.0.0');
     // Instead of using refreshUpdateStatus(), set these manually.
-    \Drupal::config('update.settings')
+    $this->config('update.settings')
       ->set('fetch.url', _url('update-test', array('absolute' => TRUE)))
       ->save();
-    \Drupal::config('update_test.settings')
+    $this->config('update_test.settings')
       ->set('xml_map', array('drupal' => '0.1'))
       ->save();
 
@@ -249,10 +249,10 @@ function testModulePageRegularUpdate() {
   function testModulePageSecurityUpdate() {
     $this->setSystemInfo('8.0.0');
     // Instead of using refreshUpdateStatus(), set these manually.
-    \Drupal::config('update.settings')
+    $this->config('update.settings')
       ->set('fetch.url', _url('update-test', array('absolute' => TRUE)))
       ->save();
-    \Drupal::config('update_test.settings')
+    $this->config('update_test.settings')
       ->set('xml_map', array('drupal' => '0.2-sec'))
       ->save();
 
@@ -324,10 +324,10 @@ function testFetchTasks() {
   function testLanguageModuleUpdate() {
     $this->setSystemInfo('8.0.0');
     // Instead of using refreshUpdateStatus(), set these manually.
-    \Drupal::config('update.settings')
+    $this->config('update.settings')
       ->set('fetch.url', _url('update-test', array('absolute' => TRUE)))
       ->save();
-    \Drupal::config('update_test.settings')
+    $this->config('update_test.settings')
       ->set('xml_map', array('drupal' => '0.1'))
       ->save();
 
diff --git a/core/modules/update/src/Tests/UpdateDeleteFileIfStaleTest.php b/core/modules/update/src/Tests/UpdateDeleteFileIfStaleTest.php
index 7cafd11..9de98a4 100644
--- a/core/modules/update/src/Tests/UpdateDeleteFileIfStaleTest.php
+++ b/core/modules/update/src/Tests/UpdateDeleteFileIfStaleTest.php
@@ -39,8 +39,7 @@ function testUpdateDeleteFileIfStale() {
     // request, so the beginning of request will be before the file changes and
     // REQUEST_TIME - $filectime is negative. Set the maximum age to a number
     // even smaller than that.
-    $this->container->get('config.factory')
-      ->get('system.file')
+    $this->config('system.file')
       ->set('temporary_maximum_age', -100000)
       ->save();
 
diff --git a/core/modules/update/src/Tests/UpdateTestBase.php b/core/modules/update/src/Tests/UpdateTestBase.php
index 0025e21..1b1c9f6 100644
--- a/core/modules/update/src/Tests/UpdateTestBase.php
+++ b/core/modules/update/src/Tests/UpdateTestBase.php
@@ -44,9 +44,9 @@
   protected function refreshUpdateStatus($xml_map, $url = 'update-test') {
     // Tell the Update Manager module to fetch from the URL provided by
     // update_test module.
-    \Drupal::config('update.settings')->set('fetch.url', _url($url, array('absolute' => TRUE)))->save();
+    $this->config('update.settings')->set('fetch.url', _url($url, array('absolute' => TRUE)))->save();
     // Save the map for update_test_mock_page() to use.
-    \Drupal::config('update_test.settings')->set('xml_map', $xml_map)->save();
+    $this->config('update_test.settings')->set('xml_map', $xml_map)->save();
     // Manually check the update status.
     $this->drupalGet('admin/reports/updates/check');
   }
diff --git a/core/modules/update/src/Tests/UpdateUploadTest.php b/core/modules/update/src/Tests/UpdateUploadTest.php
index 78a9cbd..7a916fe 100644
--- a/core/modules/update/src/Tests/UpdateUploadTest.php
+++ b/core/modules/update/src/Tests/UpdateUploadTest.php
@@ -75,11 +75,11 @@ function testUpdateManagerCoreSecurityUpdateMessages() {
         'version' => '8.0.0',
       ),
     );
-    \Drupal::config('update_test.settings')
+    $this->config('update_test.settings')
       ->set('system_info', $setting)
       ->set('xml_map', array('drupal' => '0.2-sec'))
       ->save();
-    \Drupal::config('update.settings')
+    $this->config('update.settings')
       ->set('fetch.url', _url('update-test', array('absolute' => TRUE)))
       ->save();
     // Initialize the update status.
diff --git a/core/modules/user/src/Tests/UserAccountFormFieldsTest.php b/core/modules/user/src/Tests/UserAccountFormFieldsTest.php
index 384fee3..679eec0 100644
--- a/core/modules/user/src/Tests/UserAccountFormFieldsTest.php
+++ b/core/modules/user/src/Tests/UserAccountFormFieldsTest.php
@@ -55,8 +55,7 @@ function testUserRegistrationForm() {
     $this->installConfig(array('user'));
 
     // Disable email confirmation to unlock the password field.
-    $this->container->get('config.factory')
-      ->get('user.settings')
+    $this->config('user.settings')
       ->set('verify_mail', FALSE)
       ->save();
 
diff --git a/core/modules/user/src/Tests/UserAccountLinksTests.php b/core/modules/user/src/Tests/UserAccountLinksTests.php
index cc85a86..06cac88 100644
--- a/core/modules/user/src/Tests/UserAccountLinksTests.php
+++ b/core/modules/user/src/Tests/UserAccountLinksTests.php
@@ -31,7 +31,7 @@ protected function setUp() {
     parent::setUp();
     $this->drupalPlaceBlock('system_menu_block:account');
     // Make test-page default.
-    \Drupal::config('system.site')->set('page.front', 'test-page')->save();
+    $this->config('system.site')->set('page.front', 'test-page')->save();
   }
 
   /**
diff --git a/core/modules/user/src/Tests/UserActionConfigSchemaTest.php b/core/modules/user/src/Tests/UserActionConfigSchemaTest.php
index bfc4ec8..499500d 100644
--- a/core/modules/user/src/Tests/UserActionConfigSchemaTest.php
+++ b/core/modules/user/src/Tests/UserActionConfigSchemaTest.php
@@ -43,12 +43,12 @@ function testValidUserActionConfigSchema() {
     Role::create(array('id' => $rid))->save();
 
     // Test user_add_role_action configuration.
-    $config = \Drupal::config('system.action.user_add_role_action.' . $rid);
+    $config = $this->config('system.action.user_add_role_action.' . $rid);
     $this->assertEqual($config->get('id'), 'user_add_role_action.' . $rid);
     $this->assertConfigSchema(\Drupal::service('config.typed'), $config->getName(), $config->get());
 
     // Test user_remove_role_action configuration.
-    $config = \Drupal::config('system.action.user_remove_role_action.' . $rid);
+    $config = $this->config('system.action.user_remove_role_action.' . $rid);
     $this->assertEqual($config->get('id'), 'user_remove_role_action.' . $rid);
     $this->assertConfigSchema(\Drupal::service('config.typed'), $config->getName(), $config->get());
   }
diff --git a/core/modules/user/src/Tests/UserAdminTest.php b/core/modules/user/src/Tests/UserAdminTest.php
index 900090c..135585d 100644
--- a/core/modules/user/src/Tests/UserAdminTest.php
+++ b/core/modules/user/src/Tests/UserAdminTest.php
@@ -149,14 +149,14 @@ function testNotificationEmailAddress() {
     $this->drupalLogout();
 
     // Test custom user registration approval email address(es).
-    $config = \Drupal::config('user.settings');
+    $config = $this->config('user.settings');
     // Allow users to register with admin approval.
     $config
       ->set('verify_mail', TRUE)
       ->set('register', USER_REGISTER_VISITORS_ADMINISTRATIVE_APPROVAL)
       ->save();
     // Set the site and notification email addresses.
-    $system = \Drupal::config('system.site');
+    $system = $this->config('system.site');
     $server_address = $this->randomMachineName() . '@example.com';
     $notify_address = $this->randomMachineName() . '@example.com';
     $system
diff --git a/core/modules/user/src/Tests/UserAutocompleteTest.php b/core/modules/user/src/Tests/UserAutocompleteTest.php
index a56c33c..2230e5b 100644
--- a/core/modules/user/src/Tests/UserAutocompleteTest.php
+++ b/core/modules/user/src/Tests/UserAutocompleteTest.php
@@ -45,7 +45,7 @@ function testUserAutocomplete() {
     $this->assertRaw($this->unprivileged_user->getUsername(), 'User name found in autocompletion results.');
 
     $anonymous_name = $this->randomString() . '<script>alert();</script>';
-    \Drupal::config('user.settings')->set('anonymous', $anonymous_name)->save();
+    $this->config('user.settings')->set('anonymous', $anonymous_name)->save();
     // Test that anonymous username is in the result when requested and escaped
     // with \Drupal\Component\Utility\String::checkPlain().
     $users = $this->drupalGetJSON('user/autocomplete/anonymous', array('query' => array('q' => Unicode::substr($anonymous_name, 0, 4))));
diff --git a/core/modules/user/src/Tests/UserCancelTest.php b/core/modules/user/src/Tests/UserCancelTest.php
index 9841ebe..31ef075 100644
--- a/core/modules/user/src/Tests/UserCancelTest.php
+++ b/core/modules/user/src/Tests/UserCancelTest.php
@@ -36,7 +36,7 @@ protected function setUp() {
    */
   function testUserCancelWithoutPermission() {
     $node_storage = $this->container->get('entity.manager')->getStorage('node');
-    \Drupal::config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
+    $this->config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
 
     // Create a user.
     $account = $this->drupalCreateUser(array());
@@ -108,7 +108,7 @@ function testUserCancelUid1() {
    */
   function testUserCancelInvalid() {
     $node_storage = $this->container->get('entity.manager')->getStorage('node');
-    \Drupal::config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
+    $this->config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
 
     // Create a user.
     $account = $this->drupalCreateUser(array('cancel account'));
@@ -151,7 +151,7 @@ function testUserCancelInvalid() {
    * Disable account and keep all content.
    */
   function testUserBlock() {
-    \Drupal::config('user.settings')->set('cancel_method', 'user_cancel_block')->save();
+    $this->config('user.settings')->set('cancel_method', 'user_cancel_block')->save();
 
     // Create a user.
     $web_user = $this->drupalCreateUser(array('cancel account'));
@@ -187,7 +187,7 @@ function testUserBlock() {
    */
   function testUserBlockUnpublish() {
     $node_storage = $this->container->get('entity.manager')->getStorage('node');
-    \Drupal::config('user.settings')->set('cancel_method', 'user_cancel_block_unpublish')->save();
+    $this->config('user.settings')->set('cancel_method', 'user_cancel_block_unpublish')->save();
     // Create comment field on page.
     \Drupal::service('comment.manager')->addDefaultField('node', 'page');
 
@@ -254,7 +254,7 @@ function testUserBlockUnpublish() {
    */
   function testUserAnonymize() {
     $node_storage = $this->container->get('entity.manager')->getStorage('node');
-    \Drupal::config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
+    $this->config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
 
     // Create a user.
     $account = $this->drupalCreateUser(array('cancel account'));
@@ -278,7 +278,7 @@ function testUserAnonymize() {
     $this->drupalGet('user/' . $account->id() . '/edit');
     $this->drupalPostForm(NULL, NULL, t('Cancel account'));
     $this->assertText(t('Are you sure you want to cancel your account?'), 'Confirmation form to cancel account displayed.');
-    $this->assertRaw(t('Your account will be removed and all account information deleted. All of your content will be assigned to the %anonymous-name user.', array('%anonymous-name' => \Drupal::config('user.settings')->get('anonymous'))), 'Informs that all content will be attributed to anonymous account.');
+    $this->assertRaw(t('Your account will be removed and all account information deleted. All of your content will be assigned to the %anonymous-name user.', array('%anonymous-name' => $this->config('user.settings')->get('anonymous'))), 'Informs that all content will be attributed to anonymous account.');
 
     // Confirm account cancellation.
     $timestamp = time();
@@ -308,7 +308,7 @@ function testUserAnonymize() {
    */
   function testUserDelete() {
     $node_storage = $this->container->get('entity.manager')->getStorage('node');
-    \Drupal::config('user.settings')->set('cancel_method', 'user_cancel_delete')->save();
+    $this->config('user.settings')->set('cancel_method', 'user_cancel_delete')->save();
     \Drupal::service('module_installer')->install(array('comment'));
     $this->resetAll();
     $this->container->get('comment.manager')->addDefaultField('node', 'page');
@@ -375,7 +375,7 @@ function testUserDelete() {
    * Create an administrative user and delete another user.
    */
   function testUserCancelByAdmin() {
-    \Drupal::config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
+    $this->config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
 
     // Create a regular user.
     $account = $this->drupalCreateUser(array());
@@ -400,7 +400,7 @@ function testUserCancelByAdmin() {
    * Tests deletion of a user account without an email address.
    */
   function testUserWithoutEmailCancelByAdmin() {
-    \Drupal::config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
+    $this->config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
 
     // Create a regular user.
     $account = $this->drupalCreateUser(array());
@@ -429,9 +429,9 @@ function testUserWithoutEmailCancelByAdmin() {
    */
   function testMassUserCancelByAdmin() {
     \Drupal::service('module_installer')->install(array('views'));
-    \Drupal::config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
+    $this->config('user.settings')->set('cancel_method', 'user_cancel_reassign')->save();
     // Enable account cancellation notification.
-    \Drupal::config('user.settings')->set('notify.status_canceled', TRUE)->save();
+    $this->config('user.settings')->set('notify.status_canceled', TRUE)->save();
 
     // Create administrative user.
     $admin_user = $this->drupalCreateUser(array('administer users'));
diff --git a/core/modules/user/src/Tests/UserCreateFailMailTest.php b/core/modules/user/src/Tests/UserCreateFailMailTest.php
index 677effe..04419bd 100644
--- a/core/modules/user/src/Tests/UserCreateFailMailTest.php
+++ b/core/modules/user/src/Tests/UserCreateFailMailTest.php
@@ -31,7 +31,7 @@ protected function testUserAdd() {
     $this->drupalLogin($user);
 
     // Replace the mail functionality with a fake, malfunctioning service.
-    \Drupal::config('system.mail')->set('interface.default', 'test_php_mail_failure')->save();
+    $this->config('system.mail')->set('interface.default', 'test_php_mail_failure')->save();
     // Create a user, but fail to send an email.
     $name = $this->randomMachineName();
     $edit = array(
diff --git a/core/modules/user/src/Tests/UserCreateTest.php b/core/modules/user/src/Tests/UserCreateTest.php
index 911c9ae..9020c5c 100644
--- a/core/modules/user/src/Tests/UserCreateTest.php
+++ b/core/modules/user/src/Tests/UserCreateTest.php
@@ -77,7 +77,7 @@ protected function testUserAdd() {
     $this->assertNoRaw('data-user-info-from-browser', 'Ensure form attribute, data-user-info-from-browser, does not exist.');
 
     // Test that the password strength indicator displays.
-    $config = \Drupal::config('user.settings');
+    $config = $this->config('user.settings');
 
     $config->set('password_strength', TRUE)->save();
     $this->drupalGet('admin/people/create');
diff --git a/core/modules/user/src/Tests/UserEditTest.php b/core/modules/user/src/Tests/UserEditTest.php
index 1e7dc7f..308fad9 100644
--- a/core/modules/user/src/Tests/UserEditTest.php
+++ b/core/modules/user/src/Tests/UserEditTest.php
@@ -75,7 +75,7 @@ function testUserEdit() {
     $this->drupalLogout();
 
     // Test that the password strength indicator displays.
-    $config = \Drupal::config('user.settings');
+    $config = $this->config('user.settings');
     $this->drupalLogin($user1);
 
     $config->set('password_strength', TRUE)->save();
diff --git a/core/modules/user/src/Tests/UserEditedOwnAccountTest.php b/core/modules/user/src/Tests/UserEditedOwnAccountTest.php
index 6da8015..bee1a9b 100644
--- a/core/modules/user/src/Tests/UserEditedOwnAccountTest.php
+++ b/core/modules/user/src/Tests/UserEditedOwnAccountTest.php
@@ -19,7 +19,7 @@ class UserEditedOwnAccountTest extends WebTestBase {
   function testUserEditedOwnAccount() {
     // Change account setting 'Who can register accounts?' to Administrators
     // only.
-    \Drupal::config('user.settings')->set('register', USER_REGISTER_ADMINISTRATORS_ONLY)->save();
+    $this->config('user.settings')->set('register', USER_REGISTER_ADMINISTRATORS_ONLY)->save();
 
     // Create a new user account and log in.
     $account = $this->drupalCreateUser(array('change own username'));
diff --git a/core/modules/user/src/Tests/UserEntityCallbacksTest.php b/core/modules/user/src/Tests/UserEntityCallbacksTest.php
index 9d1470b..5c4e93c 100644
--- a/core/modules/user/src/Tests/UserEntityCallbacksTest.php
+++ b/core/modules/user/src/Tests/UserEntityCallbacksTest.php
@@ -44,7 +44,7 @@ function testLabelCallback() {
 
     // Setup a random anonymous name to be sure the name is used.
     $name = $this->randomMachineName();
-    \Drupal::config('user.settings')->set('anonymous', $name)->save();
+    $this->config('user.settings')->set('anonymous', $name)->save();
     $this->assertEqual($this->anonymous->label(), $name, 'The variable anonymous should be used for name of uid 0');
   }
 
diff --git a/core/modules/user/src/Tests/UserLoginTest.php b/core/modules/user/src/Tests/UserLoginTest.php
index d37c575..43202d6 100644
--- a/core/modules/user/src/Tests/UserLoginTest.php
+++ b/core/modules/user/src/Tests/UserLoginTest.php
@@ -31,7 +31,7 @@ function testLoginDestination() {
    * Test the global login flood control.
    */
   function testGlobalLoginFloodControl() {
-    \Drupal::config('user.flood')
+    $this->config('user.flood')
       ->set('ip_limit', 10)
       // Set a high per-user limit out so that it is not relevant in the test.
       ->set('user_limit', 4000)
@@ -68,7 +68,7 @@ function testGlobalLoginFloodControl() {
    * Test the per-user login flood control.
    */
   function testPerUserLoginFloodControl() {
-    \Drupal::config('user.flood')
+    $this->config('user.flood')
       // Set a high global limit out so that it is not relevant in the test.
       ->set('ip_limit', 4000)
       ->set('user_limit', 3)
@@ -155,7 +155,7 @@ function assertFailedLogin($account, $flood_trigger = NULL) {
     $this->assertNoFieldByXPath("//input[@name='pass' and @value!='']", NULL, 'Password value attribute is blank.');
     if (isset($flood_trigger)) {
       if ($flood_trigger == 'user') {
-        $this->assertRaw(format_plural(\Drupal::config('user.flood')->get('user_limit'), 'Sorry, there has been more than one failed login attempt for this account. It is temporarily blocked. Try again later or <a href="@url">request a new password</a>.', 'Sorry, there have been more than @count failed login attempts for this account. It is temporarily blocked. Try again later or <a href="@url">request a new password</a>.', array('@url' => \Drupal::url('user.pass'))));
+        $this->assertRaw(format_plural($this->config('user.flood')->get('user_limit'), 'Sorry, there has been more than one failed login attempt for this account. It is temporarily blocked. Try again later or <a href="@url">request a new password</a>.', 'Sorry, there have been more than @count failed login attempts for this account. It is temporarily blocked. Try again later or <a href="@url">request a new password</a>.', array('@url' => \Drupal::url('user.pass'))));
       }
       else {
         // No uid, so the limit is IP-based.
diff --git a/core/modules/user/src/Tests/UserPasswordResetTest.php b/core/modules/user/src/Tests/UserPasswordResetTest.php
index e69cfa8..b0f91be 100644
--- a/core/modules/user/src/Tests/UserPasswordResetTest.php
+++ b/core/modules/user/src/Tests/UserPasswordResetTest.php
@@ -74,7 +74,7 @@ function testUserPasswordReset() {
 
      // Verify that the user was sent an email.
     $this->assertMail('to', $this->account->getEmail(), 'Password email sent to user.');
-    $subject = t('Replacement login information for @username at @site', array('@username' => $this->account->getUsername(), '@site' => \Drupal::config('system.site')->get('name')));
+    $subject = t('Replacement login information for @username at @site', array('@username' => $this->account->getUsername(), '@site' => $this->config('system.site')->get('name')));
     $this->assertMail('subject', $subject, 'Password reset email subject is correct.');
 
     $resetURL = $this->getResetURL();
@@ -87,7 +87,7 @@ function testUserPasswordReset() {
     // Check successful login.
     $this->drupalPostForm(NULL, NULL, t('Log in'));
     $this->assertLink(t('Log out'));
-    $this->assertTitle(t('@name | @site', array('@name' => $this->account->getUsername(), '@site' => \Drupal::config('system.site')->get('name'))), 'Logged in using password reset link.');
+    $this->assertTitle(t('@name | @site', array('@name' => $this->account->getUsername(), '@site' => $this->config('system.site')->get('name'))), 'Logged in using password reset link.');
 
     // Change the forgotten password.
     $password = user_password();
@@ -113,7 +113,7 @@ function testUserPasswordReset() {
     $this->assertTrue( count($this->drupalGetMails(array('id' => 'user_password_reset'))) === $before + 1, 'Email sent when requesting password reset using email address.');
 
     // Create a password reset link as if the request time was 60 seconds older than the allowed limit.
-    $timeout = \Drupal::config('user.settings')->get('password_reset_timeout');
+    $timeout = $this->config('user.settings')->get('password_reset_timeout');
     $bogus_timestamp = REQUEST_TIME - $timeout - 60;
     $_uid = $this->account->id();
     $this->drupalGet("user/reset/$_uid/$bogus_timestamp/" . user_pass_rehash($this->account->getPassword(), $bogus_timestamp, $this->account->getLastLoginTime()));
diff --git a/core/modules/user/src/Tests/UserPictureTest.php b/core/modules/user/src/Tests/UserPictureTest.php
index 639c382..13feb0f 100644
--- a/core/modules/user/src/Tests/UserPictureTest.php
+++ b/core/modules/user/src/Tests/UserPictureTest.php
@@ -65,7 +65,7 @@ function testCreateDeletePicture() {
     // configuration value.
     db_update('file_managed')
       ->fields(array(
-        'changed' => REQUEST_TIME - ($this->container->get('config.factory')->get('system.file')->get('temporary_maximum_age') + 1),
+        'changed' => REQUEST_TIME - ($this->config('system.file')->get('temporary_maximum_age') + 1),
       ))
       ->condition('fid', $file->id())
       ->execute();
@@ -91,14 +91,14 @@ function testPictureOnNodeComment() {
     $node = $this->drupalCreateNode(array('type' => 'article'));
 
     // Enable user pictures on nodes.
-    $this->container->get('config.factory')->get('system.theme.global')->set('features.node_user_picture', TRUE)->save();
+    $this->config('system.theme.global')->set('features.node_user_picture', TRUE)->save();
 
     // Verify that the image is displayed on the user account page.
     $this->drupalGet('node/' . $node->id());
     $this->assertRaw(file_uri_target($file->getFileUri()), 'User picture found on node page.');
 
     // Enable user pictures on comments, instead of nodes.
-    $this->container->get('config.factory')->get('system.theme.global')
+    $this->config('system.theme.global')
       ->set('features.node_user_picture', FALSE)
       ->set('features.comment_user_picture', TRUE)
       ->save();
@@ -113,7 +113,7 @@ function testPictureOnNodeComment() {
     $this->assertRaw(file_uri_target($file->getFileUri()), 'User picture found on comment.');
 
     // Disable user pictures on comments and nodes.
-    $this->container->get('config.factory')->get('system.theme.global')
+    $this->config('system.theme.global')
       ->set('features.node_user_picture', FALSE)
       ->set('features.comment_user_picture', FALSE)
       ->save();
diff --git a/core/modules/user/src/Tests/UserRegistrationTest.php b/core/modules/user/src/Tests/UserRegistrationTest.php
index a1f189d..853891a 100644
--- a/core/modules/user/src/Tests/UserRegistrationTest.php
+++ b/core/modules/user/src/Tests/UserRegistrationTest.php
@@ -25,7 +25,7 @@ class UserRegistrationTest extends WebTestBase {
   public static $modules = array('field_test');
 
   function testRegistrationWithEmailVerification() {
-    $config = \Drupal::config('user.settings');
+    $config = $this->config('user.settings');
     // Require email verification.
     $config->set('verify_mail', TRUE)->save();
 
@@ -58,7 +58,7 @@ function testRegistrationWithEmailVerification() {
   }
 
   function testRegistrationWithoutEmailVerification() {
-    $config = \Drupal::config('user.settings');
+    $config = $this->config('user.settings');
     // Don't require email verification and allow registration by site visitors
     // without administrator approval.
     $config
@@ -124,7 +124,7 @@ function testRegistrationWithoutEmailVerification() {
   function testRegistrationEmailDuplicates() {
     // Don't require email verification and allow registration by site visitors
     // without administrator approval.
-    \Drupal::config('user.settings')
+    $this->config('user.settings')
       ->set('verify_mail', FALSE)
       ->set('register', USER_REGISTER_VISITORS)
       ->save();
@@ -150,13 +150,13 @@ function testRegistrationEmailDuplicates() {
   function testRegistrationDefaultValues() {
     // Don't require email verification and allow registration by site visitors
     // without administrator approval.
-    $config_user_settings = \Drupal::config('user.settings')
+    $config_user_settings = $this->config('user.settings')
       ->set('verify_mail', FALSE)
       ->set('register', USER_REGISTER_VISITORS)
       ->save();
 
     // Set the default timezone to Brussels.
-    $config_system_date = \Drupal::config('system.date')
+    $config_system_date = $this->config('system.date')
       ->set('timezone.user.configurable', 1)
       ->set('timezone.default', 'Europe/Brussels')
       ->save();
diff --git a/core/modules/user/src/Tests/UserSignatureTest.php b/core/modules/user/src/Tests/UserSignatureTest.php
index 71f3148..4fa92d8 100644
--- a/core/modules/user/src/Tests/UserSignatureTest.php
+++ b/core/modules/user/src/Tests/UserSignatureTest.php
@@ -27,7 +27,7 @@ protected function setUp() {
     parent::setUp();
 
     // Enable user signatures.
-    \Drupal::config('user.settings')->set('signatures', 1)->save();
+    $this->config('user.settings')->set('signatures', 1)->save();
 
     // Create Basic page node type.
     $this->drupalCreateContentType(array('type' => 'page', 'name' => 'Basic page'));
@@ -131,7 +131,7 @@ function testUserSignature() {
     $this->assertTrue(in_array('filter_format:filtered_html_format', explode(' ', $this->drupalGetHeader('X-Drupal-Cache-Tags'))));
 
     // Verify the signature field is available on Manage form display page.
-    \Drupal::config('user.settings')->set('signatures', 0)->save();
+    $this->config('user.settings')->set('signatures', 0)->save();
     \Drupal::entityManager()->clearCachedFieldDefinitions();
     $this->drupalGet('admin/config/people/accounts/form-display');
     $this->assertNoText('Signature settings');
diff --git a/core/modules/user/src/Tests/UserTimeZoneTest.php b/core/modules/user/src/Tests/UserTimeZoneTest.php
index 4c09de0..4a75381 100644
--- a/core/modules/user/src/Tests/UserTimeZoneTest.php
+++ b/core/modules/user/src/Tests/UserTimeZoneTest.php
@@ -28,7 +28,7 @@ class UserTimeZoneTest extends WebTestBase {
    */
   function testUserTimeZone() {
     // Setup date/time settings for Los Angeles time.
-    \Drupal::config('system.date')
+    $this->config('system.date')
       ->set('timezone.user.configurable', 1)
       ->set('timezone.default', 'America/Los_Angeles')
       ->save();
diff --git a/core/modules/user/src/Tests/Views/BulkFormTest.php b/core/modules/user/src/Tests/Views/BulkFormTest.php
index 2bf721b..289c1ea 100644
--- a/core/modules/user/src/Tests/Views/BulkFormTest.php
+++ b/core/modules/user/src/Tests/Views/BulkFormTest.php
@@ -89,7 +89,7 @@ public function testBulkForm() {
 
     // Ensure the anonymous user is found.
     $this->drupalGet('test-user-bulk-form');
-    $this->assertText(\Drupal::config('user.settings')->get('anonymous'));
+    $this->assertText($this->config('user.settings')->get('anonymous'));
 
     // Attempt to block the anonymous user.
     $edit = array(
diff --git a/core/modules/user/src/Tests/Views/HandlerArgumentUserUidTest.php b/core/modules/user/src/Tests/Views/HandlerArgumentUserUidTest.php
index 2327c58..01373fb 100644
--- a/core/modules/user/src/Tests/Views/HandlerArgumentUserUidTest.php
+++ b/core/modules/user/src/Tests/Views/HandlerArgumentUserUidTest.php
@@ -41,7 +41,7 @@ public function testArgumentTitle() {
     $view->destroy();
 
     // Tests the anonymous user.
-    $anonymous = $this->container->get('config.factory')->get('user.settings')->get('anonymous');
+    $anonymous = $this->config('user.settings')->get('anonymous');
     $this->executeView($view, array(0));
     $this->assertEqual($view->getTitle(), $anonymous);
     $view->destroy();
diff --git a/core/modules/user/src/Tests/Views/HandlerFieldUserNameTest.php b/core/modules/user/src/Tests/Views/HandlerFieldUserNameTest.php
index 752d87d..c0067c9 100644
--- a/core/modules/user/src/Tests/Views/HandlerFieldUserNameTest.php
+++ b/core/modules/user/src/Tests/Views/HandlerFieldUserNameTest.php
@@ -44,7 +44,7 @@ public function testUserName() {
     $this->assertIdentical($render, $username, 'If the user is not linked the username should be printed out for a normal user.');
 
     $view->result[0]->users_field_data_uid = 0;
-    $anon_name = \Drupal::config('user.settings')->get('anonymous');
+    $anon_name = $this->config('user.settings')->get('anonymous');
     $view->result[0]->users_field_data_name = '';
     $render = $view->field['name']->advancedRender($view->result[0]);
     $this->assertIdentical($render, $anon_name , 'For user0 it should use the default anonymous name by default.');
diff --git a/core/modules/views/src/Tests/Entity/ViewEntityDependenciesTest.php b/core/modules/views/src/Tests/Entity/ViewEntityDependenciesTest.php
index 5b36b62..bc03cc0 100644
--- a/core/modules/views/src/Tests/Entity/ViewEntityDependenciesTest.php
+++ b/core/modules/views/src/Tests/Entity/ViewEntityDependenciesTest.php
@@ -110,7 +110,7 @@ public function testCalculateDependencies() {
 
       $dependencies = $view->calculateDependencies();
       $this->assertEqual($expected[$view_id], $dependencies);
-      $config = \Drupal::config('views.view.' . $view_id);
+      $config = $this->config('views.view.' . $view_id);
       \Drupal::service('config.storage.staging')->write($view_id, $config->get());
     }
   }
diff --git a/core/modules/views/src/Tests/Handler/HandlerTest.php b/core/modules/views/src/Tests/Handler/HandlerTest.php
index b182dee..f5f81b5 100644
--- a/core/modules/views/src/Tests/Handler/HandlerTest.php
+++ b/core/modules/views/src/Tests/Handler/HandlerTest.php
@@ -348,8 +348,8 @@ public function testAccess() {
     $views_data = $views_data['views_test_data'];
 
     // Enable access to callback only field and deny for callback + arguments.
-    \Drupal::config('views_test_data.tests')->set('handler_access_callback', TRUE)->save();
-    \Drupal::config('views_test_data.tests')->set('handler_access_callback_argument', FALSE)->save();
+    $this->config('views_test_data.tests')->set('handler_access_callback', TRUE)->save();
+    $this->config('views_test_data.tests')->set('handler_access_callback_argument', FALSE)->save();
     $view->initDisplay();
     $view->initHandlers();
 
@@ -361,8 +361,8 @@ public function testAccess() {
     }
 
     // Enable access to the callback + argument handlers and deny for callback.
-    \Drupal::config('views_test_data.tests')->set('handler_access_callback', FALSE)->save();
-    \Drupal::config('views_test_data.tests')->set('handler_access_callback_argument', TRUE)->save();
+    $this->config('views_test_data.tests')->set('handler_access_callback', FALSE)->save();
+    $this->config('views_test_data.tests')->set('handler_access_callback_argument', TRUE)->save();
     $view->destroy();
     $view->initDisplay();
     $view->initHandlers();
diff --git a/core/modules/views/src/Tests/Plugin/BlockDependenciesTest.php b/core/modules/views/src/Tests/Plugin/BlockDependenciesTest.php
index b7ece54..37c71e7 100644
--- a/core/modules/views/src/Tests/Plugin/BlockDependenciesTest.php
+++ b/core/modules/views/src/Tests/Plugin/BlockDependenciesTest.php
@@ -92,7 +92,7 @@ protected function createBlock($plugin_id, array $settings = array()) {
       'plugin' => $plugin_id,
       'region' => 'sidebar_first',
       'id' => strtolower($this->randomMachineName(8)),
-      'theme' => \Drupal::config('system.theme')->get('default'),
+      'theme' => $this->config('system.theme')->get('default'),
       'label' => $this->randomMachineName(8),
       'visibility' => array(),
       'weight' => 0,
diff --git a/core/modules/views/src/Tests/Plugin/DisplayExtenderTest.php b/core/modules/views/src/Tests/Plugin/DisplayExtenderTest.php
index 51ce6f5..7acdbe8 100644
--- a/core/modules/views/src/Tests/Plugin/DisplayExtenderTest.php
+++ b/core/modules/views/src/Tests/Plugin/DisplayExtenderTest.php
@@ -35,7 +35,7 @@ protected function setUp() {
    * Test display extenders.
    */
   public function testDisplayExtenders() {
-    \Drupal::config('views.settings')->set('display_extenders', array('display_extender_test'))->save();
+    $this->config('views.settings')->set('display_extenders', array('display_extender_test'))->save();
     $this->assertEqual(count(Views::getEnabledDisplayExtenders()), 1, 'Make sure that there is only one enabled display extender.');
 
     $view = Views::getView('test_view');
diff --git a/core/modules/views/src/Tests/Plugin/DisplayFeedTest.php b/core/modules/views/src/Tests/Plugin/DisplayFeedTest.php
index 97e6e99..cef9bab 100644
--- a/core/modules/views/src/Tests/Plugin/DisplayFeedTest.php
+++ b/core/modules/views/src/Tests/Plugin/DisplayFeedTest.php
@@ -47,7 +47,7 @@ public function testFeedOutput() {
 
     // Test the site name setting.
     $site_name = $this->randomMachineName();
-    $this->container->get('config.factory')->get('system.site')->set('name', $site_name)->save();
+    $this->config('system.site')->set('name', $site_name)->save();
 
     $this->drupalGet('test-feed-display.xml');
     $result = $this->xpath('//title');
diff --git a/core/modules/views/src/Tests/Plugin/DisplayTest.php b/core/modules/views/src/Tests/Plugin/DisplayTest.php
index 3c52272..4b5b638 100644
--- a/core/modules/views/src/Tests/Plugin/DisplayTest.php
+++ b/core/modules/views/src/Tests/Plugin/DisplayTest.php
@@ -237,7 +237,7 @@ public function testInvalidDisplayPlugins() {
 
     // Change the page plugin id to an invalid one. Bypass the entity system
     // so no menu rebuild was executed (so the path is still available).
-    $config = \Drupal::config('views.view.test_display_invalid');
+    $config = $this->config('views.view.test_display_invalid');
     $config->set('display.page_1.display_plugin', 'invalid');
     $config->save();
 
@@ -253,7 +253,7 @@ public function testInvalidDisplayPlugins() {
     $this->assertResponse(404);
 
     // Change the display plugin ID back to the correct ID.
-    $config = \Drupal::config('views.view.test_display_invalid');
+    $config = $this->config('views.view.test_display_invalid');
     $config->set('display.page_1.display_plugin', 'page');
     $config->save();
 
@@ -265,7 +265,7 @@ public function testInvalidDisplayPlugins() {
     $this->assertBlockAppears($block);
 
     // Change the block plugin ID to an invalid one.
-    $config = \Drupal::config('views.view.test_display_invalid');
+    $config = $this->config('views.view.test_display_invalid');
     $config->set('display.block_1.display_plugin', 'invalid');
     $config->save();
 
diff --git a/core/modules/views/src/Tests/ViewStorageTest.php b/core/modules/views/src/Tests/ViewStorageTest.php
index 36846de..4fbbd90 100644
--- a/core/modules/views/src/Tests/ViewStorageTest.php
+++ b/core/modules/views/src/Tests/ViewStorageTest.php
@@ -87,7 +87,7 @@ function testConfigurationEntityCRUD() {
    */
   protected function loadTests() {
     $view = entity_load('view', 'test_view_storage');
-    $data = \Drupal::config('views.view.test_view_storage')->get();
+    $data = $this->config('views.view.test_view_storage')->get();
 
     // Confirm that an actual view object is loaded and that it returns all of
     // expected properties.
@@ -132,7 +132,7 @@ protected function createTests() {
     }
 
     // Create a new View instance with config values.
-    $values = \Drupal::config('views.view.test_view_storage')->get();
+    $values = $this->config('views.view.test_view_storage')->get();
     $values['id'] = 'test_view_storage_new';
     unset($values['uuid']);
     $created = $this->controller->create($values);
@@ -176,7 +176,7 @@ protected function displayTests() {
     $view = $view->createDuplicate();
     $view->set('id', 'test_view_storage_new_new2');
     $view->save();
-    $values = \Drupal::config('views.view.test_view_storage_new_new2')->get();
+    $values = $this->config('views.view.test_view_storage_new_new2')->get();
 
     $this->assertTrue(isset($values['display']['test']) && is_array($values['display']['test']), 'New display was saved.');
   }
diff --git a/core/modules/views/src/Tests/ViewsThemeIntegrationTest.php b/core/modules/views/src/Tests/ViewsThemeIntegrationTest.php
index e368c84..91de60c 100644
--- a/core/modules/views/src/Tests/ViewsThemeIntegrationTest.php
+++ b/core/modules/views/src/Tests/ViewsThemeIntegrationTest.php
@@ -53,10 +53,10 @@ public function testThemedViewPage() {
     \Drupal::service('theme_handler')->install(array('test_basetheme', 'test_subtheme'));
 
     // Make base theme default then test for hook invocations.
-    \Drupal::config('system.theme')
+    $this->config('system.theme')
         ->set('default', 'test_basetheme')
         ->save();
-    $this->assertEqual(\Drupal::config('system.theme')->get('default'), 'test_basetheme');
+    $this->assertEqual($this->config('system.theme')->get('default'), 'test_basetheme');
 
     // Make sure a views rendered page is touched.
     $this->drupalGet('test_page_display_200');
@@ -66,10 +66,10 @@ public function testThemedViewPage() {
 
     // Make sub theme default to test for hook invocation
     // from both sub and base theme.
-    \Drupal::config('system.theme')
+    $this->config('system.theme')
         ->set('default', 'test_subtheme')
         ->save();
-    $this->assertEqual(\Drupal::config('system.theme')->get('default'), 'test_subtheme');
+    $this->assertEqual($this->config('system.theme')->get('default'), 'test_subtheme');
 
     // Make sure a views rendered page is touched.
     $this->drupalGet('test_page_display_200');
diff --git a/core/modules/views/src/Tests/Wizard/BasicTest.php b/core/modules/views/src/Tests/Wizard/BasicTest.php
index 32f83c1..c85c130 100644
--- a/core/modules/views/src/Tests/Wizard/BasicTest.php
+++ b/core/modules/views/src/Tests/Wizard/BasicTest.php
@@ -131,7 +131,7 @@ function testViewsWizardAndListing() {
     $this->assertNoText('REST export', 'If only the page and block options were enabled in the wizard, the resulting view does not have a REST export display.');
 
     // Confirm that the block is available in the block administration UI.
-    $this->drupalGet('admin/structure/block/list/' . \Drupal::config('system.theme')->get('default'));
+    $this->drupalGet('admin/structure/block/list/' . $this->config('system.theme')->get('default'));
     $this->assertText($view3['label']);
 
     // Place the block.
diff --git a/core/modules/views/src/Tests/Wizard/ItemsPerPageTest.php b/core/modules/views/src/Tests/Wizard/ItemsPerPageTest.php
index edb2e79..946b3c9 100644
--- a/core/modules/views/src/Tests/Wizard/ItemsPerPageTest.php
+++ b/core/modules/views/src/Tests/Wizard/ItemsPerPageTest.php
@@ -70,7 +70,7 @@ function testItemsPerPage() {
     $this->assertTrue($pos5 < $pos4 && $pos4 < $pos3 && $pos3 < $pos2, 'The nodes appear in the expected order in the page display.');
 
     // Confirm that the block is listed in the block administration UI.
-    $this->drupalGet('admin/structure/block/list/' . \Drupal::config('system.theme')->get('default'));
+    $this->drupalGet('admin/structure/block/list/' . $this->config('system.theme')->get('default'));
     $this->assertText($view['label']);
 
     // Place the block, visit a page that displays the block, and check that the
diff --git a/core/modules/views/src/Tests/Wizard/WizardPluginBaseUnitTest.php b/core/modules/views/src/Tests/Wizard/WizardPluginBaseUnitTest.php
index 281539b..10cc379 100644
--- a/core/modules/views/src/Tests/Wizard/WizardPluginBaseUnitTest.php
+++ b/core/modules/views/src/Tests/Wizard/WizardPluginBaseUnitTest.php
@@ -57,7 +57,7 @@ public function testCreateView() {
 
     // Add a new language and mark it as default.
     ConfigurableLanguage::createFromLangcode('it')->save();
-    \Drupal::config('system.site')->set('langcode', 'it')->save();
+    $this->config('system.site')->set('langcode', 'it')->save();
 
     $form_state->setValues([
       'id' => $random_id,
diff --git a/core/modules/views_ui/src/Tests/DefaultViewsTest.php b/core/modules/views_ui/src/Tests/DefaultViewsTest.php
index 080d774..9c15ba8 100644
--- a/core/modules/views_ui/src/Tests/DefaultViewsTest.php
+++ b/core/modules/views_ui/src/Tests/DefaultViewsTest.php
@@ -80,7 +80,7 @@ function testDefaultViews() {
     $edit = array(
       'id' => 'duplicate_of_glossary',
     );
-    $this->assertTitle(t('Duplicate of @label | @site-name', array('@label' => 'Glossary', '@site-name' => \Drupal::config('system.site')->get('name'))));
+    $this->assertTitle(t('Duplicate of @label | @site-name', array('@label' => 'Glossary', '@site-name' => $this->config('system.site')->get('name'))));
     $this->drupalPostForm(NULL, $edit, t('Duplicate'));
     $this->assertUrl('admin/structure/views/view/duplicate_of_glossary', array(), 'The normal duplicating name schema is applied.');
 
diff --git a/core/modules/views_ui/src/Tests/DisplayCRUDTest.php b/core/modules/views_ui/src/Tests/DisplayCRUDTest.php
index 4f1d2e2..9b011cf 100644
--- a/core/modules/views_ui/src/Tests/DisplayCRUDTest.php
+++ b/core/modules/views_ui/src/Tests/DisplayCRUDTest.php
@@ -35,7 +35,7 @@ class DisplayCRUDTest extends UITestBase {
    */
   public function testAddDisplay() {
     // Show the master display.
-    \Drupal::config('views.settings')->set('ui.show.master_display', TRUE)->save();
+    $this->config('views.settings')->set('ui.show.master_display', TRUE)->save();
 
     $settings['page[create]'] = FALSE;
     $view = $this->randomView($settings);
diff --git a/core/modules/views_ui/src/Tests/DisplayExtenderUITest.php b/core/modules/views_ui/src/Tests/DisplayExtenderUITest.php
index 30a5c7e..deb1bb6 100644
--- a/core/modules/views_ui/src/Tests/DisplayExtenderUITest.php
+++ b/core/modules/views_ui/src/Tests/DisplayExtenderUITest.php
@@ -27,7 +27,7 @@ class DisplayExtenderUITest extends UITestBase {
    * Tests the display extender UI.
    */
   public function testDisplayExtenderUI() {
-    \Drupal::config('views.settings')->set('display_extenders', array('display_extender_test'))->save();
+    $this->config('views.settings')->set('display_extenders', array('display_extender_test'))->save();
 
     $view = Views::getView('test_view');
     $view_edit_url = "admin/structure/views/view/{$view->storage->id()}/edit";
diff --git a/core/modules/views_ui/src/Tests/DisplayTest.php b/core/modules/views_ui/src/Tests/DisplayTest.php
index 1188f5d..ca29239 100644
--- a/core/modules/views_ui/src/Tests/DisplayTest.php
+++ b/core/modules/views_ui/src/Tests/DisplayTest.php
@@ -112,7 +112,7 @@ public function testDisplayPluginsAlter() {
    */
   public function testDisplayAreas() {
     // Show the advanced column.
-    \Drupal::config('views.settings')->set('ui.show.advanced_column', TRUE)->save();
+    $this->config('views.settings')->set('ui.show.advanced_column', TRUE)->save();
 
     // Add a new data display to the view.
     $view = Views::getView('test_display');
diff --git a/core/modules/views_ui/src/Tests/OverrideDisplaysTest.php b/core/modules/views_ui/src/Tests/OverrideDisplaysTest.php
index a3d4396..c6a15d9 100644
--- a/core/modules/views_ui/src/Tests/OverrideDisplaysTest.php
+++ b/core/modules/views_ui/src/Tests/OverrideDisplaysTest.php
@@ -49,7 +49,7 @@ function testOverrideDisplays() {
     $this->assertText($original_title);
 
     // Confirm that the view block is available in the block administration UI.
-    $this->drupalGet('admin/structure/block/list/' . \Drupal::config('system.theme')->get('default'));
+    $this->drupalGet('admin/structure/block/list/' . $this->config('system.theme')->get('default'));
     $this->assertText($view['label']);
 
     // Place the block.
@@ -108,7 +108,7 @@ function testWizardMixedDefaultOverriddenDisplays() {
     $this->assertNoText($view['block[title]']);
 
     // Confirm that the block is available in the block administration UI.
-    $this->drupalGet('admin/structure/block/list/' . \Drupal::config('system.theme')->get('default'));
+    $this->drupalGet('admin/structure/block/list/' . $this->config('system.theme')->get('default'));
     $this->assertText($view['label']);
 
     // Put the block into the first sidebar region, and make sure it will not
diff --git a/core/profiles/standard/src/Tests/StandardTest.php b/core/profiles/standard/src/Tests/StandardTest.php
index 567cb9f..f8d4999 100644
--- a/core/profiles/standard/src/Tests/StandardTest.php
+++ b/core/profiles/standard/src/Tests/StandardTest.php
@@ -98,11 +98,10 @@ function testStandard() {
     // conformance. Ensures all imported default configuration is valid when
     // standard profile modules are enabled.
     $names = $this->container->get('config.storage')->listAll();
-    $factory = $this->container->get('config.factory');
     /** @var \Drupal\Core\Config\TypedConfigManagerInterface $typed_config */
     $typed_config = $this->container->get('config.typed');
     foreach ($names as $name) {
-      $config = $factory->get($name);
+      $config = $this->config($name);
       $this->assertConfigSchema($typed_config, $name, $config->get());
     }
 
diff --git a/core/tests/Drupal/Tests/Core/DrupalTest.php b/core/tests/Drupal/Tests/Core/DrupalTest.php
index 4af023d..8a36cfd 100644
--- a/core/tests/Drupal/Tests/Core/DrupalTest.php
+++ b/core/tests/Drupal/Tests/Core/DrupalTest.php
@@ -133,6 +133,7 @@ public function testConfig() {
       ->will($this->returnValue(TRUE));
     $this->setMockContainerService('config.factory', $config);
 
+    // Test \Drupal::config(), not $this->config().
     $this->assertNotNull(\Drupal::config('test_config'));
   }
 
