diff --git a/core/modules/config/src/Tests/ConfigEventsTest.php b/core/modules/config/src/Tests/ConfigEventsTest.php index 2d2aea1..b4f7279 100644 --- a/core/modules/config/src/Tests/ConfigEventsTest.php +++ b/core/modules/config/src/Tests/ConfigEventsTest.php @@ -67,7 +67,7 @@ function testConfigRenameEvent() { $GLOBALS['config'][$name] = array('key' => 'overridden'); $GLOBALS['config'][$new_name] = array('key' => 'new overridden'); - $config = $this->config($name); + $config = \Drupal::config($name); $config->set('key', 'initial')->save(); $event = \Drupal::state()->get('config_events_test.event', array()); $this->assertIdentical($event['event_name'], ConfigEvents::SAVE); diff --git a/core/modules/config/src/Tests/ConfigExportUITest.php b/core/modules/config/src/Tests/ConfigExportUITest.php index ae914a0..fe3ae8d 100644 --- a/core/modules/config/src/Tests/ConfigExportUITest.php +++ b/core/modules/config/src/Tests/ConfigExportUITest.php @@ -70,7 +70,7 @@ function testExport() { $this->assertIdentical($archive_contents, $config_files); // Ensure the test configuration override is in effect but was not exported. - $this->assertIdentical($this->config('system.maintenance')->get('message'), 'Foo'); + $this->assertIdentical(\Drupal::config('system.maintenance')->get('message'), 'Foo'); $archiver->extract(file_directory_temp(), array('system.maintenance.yml')); $file_contents = file_get_contents(file_directory_temp() . '/' . 'system.maintenance.yml'); $exported = Yaml::decode($file_contents); diff --git a/core/modules/config/src/Tests/ConfigLanguageOverrideTest.php b/core/modules/config/src/Tests/ConfigLanguageOverrideTest.php index 270ac9d..2371a88 100644 --- a/core/modules/config/src/Tests/ConfigLanguageOverrideTest.php +++ b/core/modules/config/src/Tests/ConfigLanguageOverrideTest.php @@ -37,7 +37,7 @@ function testConfigLanguageOverride() { // overrides configuration when the Language module is enabled. This test ensures that // English overrides work. \Drupal::languageManager()->setConfigOverrideLanguage(language_load('en')); - $config = $this->config('config_test.system'); + $config = \Drupal::config('config_test.system'); $this->assertIdentical($config->get('foo'), 'en bar'); // Ensure that the raw data is not translated. @@ -48,11 +48,11 @@ function testConfigLanguageOverride() { ConfigurableLanguage::createFromLangcode('de')->save(); \Drupal::languageManager()->setConfigOverrideLanguage(language_load('fr')); - $config = $this->config('config_test.system'); + $config = \Drupal::config('config_test.system'); $this->assertIdentical($config->get('foo'), 'fr bar'); \Drupal::languageManager()->setConfigOverrideLanguage(language_load('de')); - $config = $this->config('config_test.system'); + $config = \Drupal::config('config_test.system'); $this->assertIdentical($config->get('foo'), 'de bar'); // Test overrides of completely new configuration objects. In normal runtime @@ -62,18 +62,18 @@ function testConfigLanguageOverride() { ->getLanguageConfigOverride('de', 'config_test.new') ->set('language', 'override') ->save(); - $config = $this->config('config_test.new'); + $config = \Drupal::config('config_test.new'); $this->assertTrue($config->isNew(), 'The configuration object config_test.new is new'); $this->assertIdentical($config->get('language'), 'override'); $old_state = \Drupal::configFactory()->getOverrideState(); \Drupal::configFactory()->setOverrideState(FALSE); - $config = $this->config('config_test.new'); + $config = \Drupal::config('config_test.new'); $this->assertIdentical($config->get('language'), NULL); \Drupal::configFactory()->setOverrideState($old_state); // Test how overrides react to base configuration changes. Set up some base // values. - $this->config('config_test.foo') + \Drupal::config('config_test.foo') ->set('value', array('key' => 'original')) ->set('label', 'Original') ->save(); @@ -87,12 +87,12 @@ function testConfigLanguageOverride() { ->set('value', array('key' => 'override')) ->save(); \Drupal::configFactory()->clearStaticCache(); - $config = $this->config('config_test.foo'); + $config = \Drupal::config('config_test.foo'); $this->assertIdentical($config->get('value'), array('key' => 'override')); // Ensure renaming the config will rename the override. \Drupal::configFactory()->rename('config_test.foo', 'config_test.bar'); - $config = $this->config('config_test.bar'); + $config = \Drupal::config('config_test.bar'); $this->assertEqual($config->get('value'), array('key' => 'original')); $override = \Drupal::languageManager()->getLanguageConfigOverride('de', 'config_test.foo'); $this->assertTrue($override->isNew()); @@ -105,7 +105,7 @@ function testConfigLanguageOverride() { $this->assertEqual($override->get('value'), array('key' => 'override')); // Ensure changing data in the config will update the overrides. - $config = $this->config('config_test.bar')->clear('value.key')->save(); + $config = \Drupal::config('config_test.bar')->clear('value.key')->save(); $this->assertEqual($config->get('value'), array()); $override = \Drupal::languageManager()->getLanguageConfigOverride('de', 'config_test.bar'); $this->assertFalse($override->isNew()); diff --git a/core/modules/config/src/Tests/ConfigOverrideTest.php b/core/modules/config/src/Tests/ConfigOverrideTest.php index 3da4eb1..38ba0a1 100644 --- a/core/modules/config/src/Tests/ConfigOverrideTest.php +++ b/core/modules/config/src/Tests/ConfigOverrideTest.php @@ -56,7 +56,7 @@ function testConfOverride() { $this->assertIdentical($data['404'], $expected_original_data['404']); // Get the configuration object in with overrides. - $config = $this->config('config_test.system'); + $config = \Drupal::config('config_test.system'); // Verify that it contains the overridden data from $config. $this->assertIdentical($config->get('foo'), $overrides['config_test.system']['foo']); @@ -80,7 +80,7 @@ function testConfOverride() { $config->save(); // Reload it and verify that it still contains overridden data from $config. - $config = $this->config('config_test.system'); + $config = \Drupal::config('config_test.system'); $this->assertIdentical($config->get('foo'), $overrides['config_test.system']['foo']); $this->assertIdentical($config->get('baz'), $overrides['config_test.system']['baz']); $this->assertIdentical($config->get('404'), $overrides['config_test.system']['404']); @@ -104,7 +104,7 @@ function testConfOverride() { $this->assertIdentical($data['404'], $expected_new_data['404']); // Verifiy the overrides are still working. - $config = $this->config('config_test.system'); + $config = \Drupal::config('config_test.system'); $this->assertIdentical($config->get('foo'), $overrides['config_test.system']['foo']); $this->assertIdentical($config->get('baz'), $overrides['config_test.system']['baz']); $this->assertIdentical($config->get('404'), $overrides['config_test.system']['404']); @@ -113,12 +113,12 @@ function testConfOverride() { // this should only happen for configuration entities as we should not be // creating simple configuration objects on the fly. $GLOBALS['config']['config_test.new']['key'] = 'override'; - $config = $this->config('config_test.new'); + $config = \Drupal::config('config_test.new'); $this->assertTrue($config->isNew(), 'The configuration object config_test.new is new'); $this->assertIdentical($config->get('key'), 'override'); $old_state = \Drupal::configFactory()->getOverrideState(); \Drupal::configFactory()->setOverrideState(FALSE); - $config_raw = $this->config('config_test.new'); + $config_raw = \Drupal::config('config_test.new'); $this->assertIdentical($config_raw->get('key'), NULL); $config_raw ->set('key', 'raw')