Commit 523964ba authored by webchick's avatar webchick

Issue #2192693 by alexpott, swentel: Remove config.inc.

parent 408b0ad3
......@@ -1714,9 +1714,6 @@ function _drupal_bootstrap_configuration() {
// Detect string handling method.
Unicode::check();
// Load the procedural configuration system helper functions.
require_once __DIR__ . '/config.inc';
// Set the Drupal custom error handler. (requires \Drupal::config())
set_error_handler('_drupal_error_handler');
set_exception_handler('_drupal_exception_handler');
......
<?php
/**
* @file
* This is the API for configuration storage.
*/
/**
* Gets configuration object names starting with a given prefix.
*
* @deprecated Deprecated since Drupal 8.x-dev, to be removed in Drupal 8.0.
* Use \Drupal::configFactory()->listAll() instead.
*/
function config_get_storage_names_with_prefix($prefix = '') {
return \Drupal::configFactory()->listAll($prefix);
}
/**
* Retrieves a configuration object.
*
* This is the main entry point to the configuration API. Calling
* @code \Drupal::config('book.admin') @endcode will return a configuration
* object in which the book module can store its administrative settings.
*
* @deprecated in Drupal 8.x-dev, will be removed before Drupal 8.0.
* Use \Drupal::config().
*
* @param string $name
* The name of the configuration object to retrieve. The name corresponds to
* a configuration file. For @code \Drupal::config('book.admin') @endcode,
* the config object returned will contain the contents of book.admin
* configuration file.
*
* @return \Drupal\Core\Config\Config
* A configuration object.
*/
function config($name) {
return \Drupal::config($name);
}
/**
* Returns the typed config manager service.
*
* Use the typed data manager service for creating typed configuration objects.
*
* @deprecated Deprecated since Drupal 8.x-dev, to be removed in Drupal 8.0.
* Use \Drupal::service('config.typed') instead.
*
* @see \Drupal\Core\TypedData\TypedDataManager::create()
*
* @return \Drupal\Core\Config\TypedConfigManager
*/
function config_typed() {
return \Drupal::service('config.typed');
}
......@@ -825,7 +825,7 @@ function update_language_list($flags = Language::STATE_CONFIGURABLE) {
if (\Drupal::languageManager()->isMultilingual() || \Drupal::moduleHandler()->moduleExists('language')) {
// Use language module configuration if available. We can not use
// entity_load_multiple() because this breaks during updates.
$language_entities = config_get_storage_names_with_prefix('language.entity.');
$language_entities = \Drupal::configFactory()->listAll('language.entity.');
// Initialize default property so callers have an easy reference and can
// save the same object without data loss.
......
......@@ -25,7 +25,7 @@ abstract class Element extends TypedData {
* Create typed config object.
*/
protected function parseElement($key, $data, $definition) {
return config_typed()->create($definition, $data, $key, $this);
return \Drupal::service('config.typed')->create($definition, $data, $key, $this);
}
}
......@@ -112,7 +112,7 @@ function custom_block_entity_type_alter(array &$entity_types) {
*/
function custom_block_entity_bundle_info() {
$bundles = array();
foreach (config_get_storage_names_with_prefix('custom_block.type.') as $config_name) {
foreach (\Drupal::configFactory()->listAll('custom_block.type.') as $config_name) {
$config = \Drupal::config($config_name);
$bundles['custom_block'][$config->get('id')]['label'] = $config->get('label');
}
......
......@@ -79,7 +79,7 @@ function breakpoint_modules_uninstalled($modules) {
* Either Breakpoint::SOURCE_TYPE_THEME or Breakpoint::SOURCE_TYPE_MODULE.
*/
function _breakpoint_delete_breakpoints($list, $source_type) {
$ids = config_get_storage_names_with_prefix('breakpoint.breakpoint_group.' . $source_type . '.');
$ids = \Drupal::configFactory()->listAll('breakpoint.breakpoint_group.' . $source_type . '.');
$entity_manager = \Drupal::entityManager();
$entity_type = $entity_manager->getDefinition('breakpoint_group');
......
......@@ -41,21 +41,21 @@ public function setUp() {
*/
function testSchemaMapping() {
// Nonexistent configuration key will have Unknown as metadata.
$this->assertIdentical(FALSE, config_typed()->hasConfigSchema('config_test.no_such_key'));
$definition = config_typed()->getDefinition('config_test.no_such_key');
$this->assertIdentical(FALSE, \Drupal::service('config.typed')->hasConfigSchema('config_test.no_such_key'));
$definition = \Drupal::service('config.typed')->getDefinition('config_test.no_such_key');
$expected = array();
$expected['label'] = 'Unknown';
$expected['class'] = '\Drupal\Core\Config\Schema\Property';
$this->assertEqual($definition, $expected, 'Retrieved the right metadata for nonexistent configuration.');
// Configuration file without schema will return Unknown as well.
$this->assertIdentical(FALSE, config_typed()->hasConfigSchema('config_test.noschema'));
$definition = config_typed()->getDefinition('config_test.noschema');
$this->assertIdentical(FALSE, \Drupal::service('config.typed')->hasConfigSchema('config_test.noschema'));
$definition = \Drupal::service('config.typed')->getDefinition('config_test.noschema');
$this->assertEqual($definition, $expected, 'Retrieved the right metadata for configuration with no schema.');
// Configuration file with only some schema.
$this->assertIdentical(TRUE, config_typed()->hasConfigSchema('config_test.someschema'));
$definition = config_typed()->getDefinition('config_test.someschema');
$this->assertIdentical(TRUE, \Drupal::service('config.typed')->hasConfigSchema('config_test.someschema'));
$definition = \Drupal::service('config.typed')->getDefinition('config_test.someschema');
$expected = array();
$expected['label'] = 'Schema test data';
$expected['class'] = '\Drupal\Core\Config\Schema\Mapping';
......@@ -64,7 +64,7 @@ function testSchemaMapping() {
$this->assertEqual($definition, $expected, 'Retrieved the right metadata for configuration with only some schema.');
// Check type detection on elements with undefined types.
$config = config_typed()->get('config_test.someschema');
$config = \Drupal::service('config.typed')->get('config_test.someschema');
$definition = $config['testitem']->getDataDefinition();
$expected = array();
$expected['label'] = 'Test item';
......@@ -79,7 +79,7 @@ function testSchemaMapping() {
$this->assertEqual($definition, $expected, 'Automatic type fallback on non-string item worked.');
// Simple case, straight metadata.
$definition = config_typed()->getDefinition('system.maintenance');
$definition = \Drupal::service('config.typed')->getDefinition('system.maintenance');
$expected = array();
$expected['label'] = 'Maintenance mode';
$expected['class'] = '\Drupal\Core\Config\Schema\Mapping';
......@@ -94,7 +94,7 @@ function testSchemaMapping() {
$this->assertEqual($definition, $expected, 'Retrieved the right metadata for system.maintenance');
// More complex case, generic type. Metadata for image style.
$definition = config_typed()->getDefinition('image.style.large');
$definition = \Drupal::service('config.typed')->getDefinition('image.style.large');
$expected = array();
$expected['label'] = 'Image style';
$expected['class'] = '\Drupal\Core\Config\Schema\Mapping';
......@@ -116,7 +116,7 @@ function testSchemaMapping() {
$this->assertEqual($definition, $expected, 'Retrieved the right metadata for image.style.large');
// More complex, type based on a complex one.
$definition = config_typed()->getDefinition('image.effect.image_scale');
$definition = \Drupal::service('config.typed')->getDefinition('image.effect.image_scale');
// This should be the schema for image.effect.image_scale.
$expected = array();
$expected['label'] = 'Image scale';
......@@ -131,7 +131,7 @@ function testSchemaMapping() {
$this->assertEqual($definition, $expected, 'Retrieved the right metadata for image.effect.image_scale');
// Most complex case, get metadata for actual configuration element.
$effects = config_typed()->get('image.style.medium')->get('effects');
$effects = \Drupal::service('config.typed')->get('image.style.medium')->get('effects');
$definition = $effects['bddf0d06-42f9-4c75-a700-a33cafa25ea0']['data']->getDataDefinition();
// This should be the schema for image.effect.image_scale, reuse previous one.
$expected['type'] = 'image.effect.image_scale';
......@@ -139,7 +139,7 @@ function testSchemaMapping() {
$this->assertEqual($definition, $expected, 'Retrieved the right metadata for the first effect of image.style.medium');
// More complex, multiple filesystem marker test.
$definition = config_typed()->getDefinition('config_test.someschema.somemodule.section_one.subsection');
$definition = \Drupal::service('config.typed')->getDefinition('config_test.someschema.somemodule.section_one.subsection');
// This should be the schema of config_test.someschema.somemodule.*.*.
$expected = array();
$expected['label'] = 'Schema multiple filesytem marker test';
......@@ -151,7 +151,7 @@ function testSchemaMapping() {
$this->assertEqual($definition, $expected, 'Retrieved the right metadata for config_test.someschema.somemodule.section_one.subsection');
$definition = config_typed()->getDefinition('config_test.someschema.somemodule.section_two.subsection');
$definition = \Drupal::service('config.typed')->getDefinition('config_test.someschema.somemodule.section_two.subsection');
// The other file should have the same schema.
$this->assertEqual($definition, $expected, 'Retrieved the right metadata for config_test.someschema.somemodule.section_two.subsection');
}
......@@ -160,7 +160,7 @@ function testSchemaMapping() {
* Tests metadata retrieval with several levels of %parent indirection.
*/
function testSchemaMappingWithParents() {
$config_data = config_typed()->get('config_test.someschema.with_parents');
$config_data = \Drupal::service('config.typed')->get('config_test.someschema.with_parents');
// Test fetching parent one level up.
$entry = $config_data->get('one_level');
......@@ -198,7 +198,7 @@ function testSchemaMappingWithParents() {
*/
function testSchemaData() {
// Try some simple properties.
$meta = config_typed()->get('system.site');
$meta = \Drupal::service('config.typed')->get('system.site');
$property = $meta->get('name');
$this->assertTrue($property instanceof StringInterface, 'Got the right wrapper fo the site name property.');
$this->assertEqual($property->getValue(), 'Drupal', 'Got the right string value for site name data.');
......@@ -224,7 +224,7 @@ function testSchemaData() {
$this->assertTrue(count($values) == 3 && $values['front'] == 'user', 'Got the right property values for site page.');
// Now let's try something more complex, with nested objects.
$wrapper = config_typed()->get('image.style.large');
$wrapper = \Drupal::service('config.typed')->get('image.style.large');
$effects = $wrapper->get('effects');
// The function is_array() doesn't work with ArrayAccess, so we use count().
......@@ -237,7 +237,7 @@ function testSchemaData() {
// Finally update some object using a configuration wrapper.
$new_slogan = 'Site slogan for testing configuration metadata';
$wrapper = config_typed()->get('system.site');
$wrapper = \Drupal::service('config.typed')->get('system.site');
$wrapper->set('slogan', $new_slogan);
$site_slogan = $wrapper->get('slogan');
$this->assertEqual($site_slogan->getValue(), $new_slogan, 'Successfully updated the contained configuration data');
......
......@@ -84,7 +84,7 @@ function contact_entity_type_alter(array &$entity_types) {
*/
function contact_entity_bundle_info() {
$bundles = array();
foreach (config_get_storage_names_with_prefix('contact.category.') as $config_name) {
foreach (\Drupal::configFactory()->listAll('contact.category.') as $config_name) {
$config = \Drupal::config($config_name);
$bundles['contact_message'][$config->get('id')]['label'] = $config->get('label');
}
......
......@@ -146,7 +146,7 @@ function content_translation_entity_bundle_info_alter(&$bundles) {
* Implements hook_entity_field_info_alter().
*/
function content_translation_entity_field_info_alter(&$info, $entity_type) {
$translation_settings = config('content_translation.settings')->get($entity_type);
$translation_settings = \Drupal::config('content_translation.settings')->get($entity_type);
if ($translation_settings) {
// Currently field translatability is defined per-field but we may want to
......
......@@ -81,7 +81,7 @@ function entity_entity_bundle_rename($entity_type_id, $bundle_old, $bundle_new)
// Rename entity displays.
$entity_type = \Drupal::entityManager()->getDefinition('entity_view_display');
if ($bundle_old !== $bundle_new) {
$ids = config_get_storage_names_with_prefix('entity.view_display.' . $entity_type_id . '.' . $bundle_old . '.');
$ids = \Drupal::configFactory()->listAll('entity.view_display.' . $entity_type_id . '.' . $bundle_old . '.');
foreach ($ids as $id) {
$id = ConfigStorageController::getIDFromConfigName($id, $entity_type->getConfigPrefix());
$display = entity_load('entity_view_display', $id);
......@@ -95,7 +95,7 @@ function entity_entity_bundle_rename($entity_type_id, $bundle_old, $bundle_new)
// Rename entity form displays.
$entity_type = \Drupal::entityManager()->getDefinition('entity_form_display');
if ($bundle_old !== $bundle_new) {
$ids = config_get_storage_names_with_prefix('entity.form_display.' . $entity_type_id . '.' . $bundle_old . '.');
$ids = \Drupal::configFactory()->listAll('entity.form_display.' . $entity_type_id . '.' . $bundle_old . '.');
foreach ($ids as $id) {
$id = ConfigStorageController::getIDFromConfigName($id, $entity_type->getConfigPrefix());
$form_display = entity_load('entity_form_display', $id);
......@@ -113,7 +113,7 @@ function entity_entity_bundle_rename($entity_type_id, $bundle_old, $bundle_new)
function entity_entity_bundle_delete($entity_type_id, $bundle) {
// Remove entity displays of the deleted bundle.
$entity_type = \Drupal::entityManager()->getDefinition('entity_view_display');
$ids = config_get_storage_names_with_prefix('entity.view_display.' . $entity_type_id . '.' . $bundle . '.');
$ids = \Drupal::configFactory()->listAll('entity.view_display.' . $entity_type_id . '.' . $bundle . '.');
foreach ($ids as &$id) {
$id = ConfigStorageController::getIDFromConfigName($id, $entity_type->getConfigPrefix());
}
......@@ -121,7 +121,7 @@ function entity_entity_bundle_delete($entity_type_id, $bundle) {
// Remove entity form displays of the deleted bundle.
$entity_type = \Drupal::entityManager()->getDefinition('entity_form_display');
$ids = config_get_storage_names_with_prefix('entity.form_display.' . $entity_type_id . '.' . $bundle . '.');
$ids = \Drupal::configFactory()->listAll('entity.form_display.' . $entity_type_id . '.' . $bundle . '.');
foreach ($ids as &$id) {
$id = ConfigStorageController::getIDFromConfigName($id, $entity_type->getConfigPrefix());
}
......
......@@ -59,7 +59,7 @@ class FieldInfo {
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected $config;
protected $configFactory;
/**
* The language manager.
......@@ -136,7 +136,7 @@ class FieldInfo {
*
* @param \Drupal\Core\Cache\CacheBackendInterface $cache_backend
* The cache backend to use.
* @param \Drupal\Core\Config\ConfigFactoryInterface $config
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The configuration factory object to use.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler class to use for invoking hooks.
......@@ -145,10 +145,10 @@ class FieldInfo {
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager to use.
*/
public function __construct(CacheBackendInterface $cache_backend, ConfigFactoryInterface $config, ModuleHandlerInterface $module_handler, FieldTypePluginManagerInterface $field_type_manager, LanguageManagerInterface $language_manager) {
public function __construct(CacheBackendInterface $cache_backend, ConfigFactoryInterface $config_factory, ModuleHandlerInterface $module_handler, FieldTypePluginManagerInterface $field_type_manager, LanguageManagerInterface $language_manager) {
$this->cacheBackend = $cache_backend;
$this->moduleHandler = $module_handler;
$this->config = $config;
$this->configFactory = $config_factory;
$this->fieldTypeManager = $field_type_manager;
$this->languageManager = $language_manager;
}
......@@ -201,13 +201,13 @@ public function getFieldMap() {
$map = array();
// Get fields.
foreach (config_get_storage_names_with_prefix('field.field.') as $config_id) {
$field_config = $this->config->get($config_id)->get();
foreach ($this->configFactory->listAll('field.field.') as $config_id) {
$field_config = $this->configFactory->get($config_id)->get();
$fields[$field_config['uuid']] = $field_config;
}
// Get field instances.
foreach (config_get_storage_names_with_prefix('field.instance.') as $config_id) {
$instance_config = $this->config->get($config_id)->get();
foreach ($this->configFactory->listAll('field.instance.') as $config_id) {
$instance_config = $this->configFactory->get($config_id)->get();
$field_uuid = $instance_config['field_uuid'];
if (isset($fields[$field_uuid])) {
$field = $fields[$field_uuid];
......
......@@ -8,6 +8,7 @@
namespace Drupal\field_ui;
use Drupal\Component\Plugin\PluginManagerBase;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
use Drupal\Core\Entity\Display\EntityDisplayInterface;
use Drupal\Core\Entity\EntityManagerInterface;
......@@ -43,9 +44,11 @@ class DisplayOverview extends DisplayOverviewBase {
* The widget or formatter plugin manager.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler class to use for invoking hooks.
* @param \Drupal\Core\Config\ConfigFactory $config_factory
* The configuration factory.
*/
public function __construct(EntityManagerInterface $entity_manager, FieldTypePluginManager $field_type_manager, PluginManagerBase $plugin_manager, ModuleHandlerInterface $module_handler) {
parent::__construct($entity_manager, $field_type_manager, $plugin_manager);
public function __construct(EntityManagerInterface $entity_manager, FieldTypePluginManager $field_type_manager, PluginManagerBase $plugin_manager, ModuleHandlerInterface $module_handler, ConfigFactoryInterface $config_factory) {
parent::__construct($entity_manager, $field_type_manager, $plugin_manager, $config_factory);
$this->moduleHandler = $module_handler;
}
......@@ -57,8 +60,9 @@ public static function create(ContainerInterface $container) {
$container->get('entity.manager'),
$container->get('plugin.manager.field.field_type'),
$container->get('plugin.manager.field.formatter'),
$container->get('module_handler')
);
$container->get('module_handler'),
$container->get('config.factory')
);
}
/**
......
......@@ -8,6 +8,7 @@
namespace Drupal\field_ui;
use Drupal\Component\Plugin\PluginManagerBase;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Entity\Display\EntityDisplayInterface;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Field\FieldDefinitionInterface;
......@@ -40,6 +41,13 @@ abstract class DisplayOverviewBase extends OverviewBase {
*/
protected $fieldTypes;
/**
* The config factory.
*
* @var \Drupal\Core\Config\ConfigFactoryInterface
*/
protected $configFactory;
/**
* Constructs a new DisplayOverviewBase.
*
......@@ -49,12 +57,15 @@ abstract class DisplayOverviewBase extends OverviewBase {
* The field type manager.
* @param \Drupal\Component\Plugin\PluginManagerBase $plugin_manager
* The widget or formatter plugin manager.
* @param \Drupal\Core\Config\ConfigFactory $config_factory
* The configuration factory.
*/
public function __construct(EntityManagerInterface $entity_manager, FieldTypePluginManagerInterface $field_type_manager, PluginManagerBase $plugin_manager) {
public function __construct(EntityManagerInterface $entity_manager, FieldTypePluginManagerInterface $field_type_manager, PluginManagerBase $plugin_manager, ConfigFactoryInterface $config_factory) {
parent::__construct($entity_manager);
$this->fieldTypes = $field_type_manager->getConfigurableDefinitions();
$this->pluginManager = $plugin_manager;
$this->configFactory = $config_factory;
}
/**
......@@ -64,7 +75,8 @@ public static function create(ContainerInterface $container) {
return new static(
$container->get('entity.manager'),
$container->get('plugin.manager.field.field_type'),
$container->get('plugin.manager.field.widget')
$container->get('plugin.manager.field.widget'),
$container->get('config.factory')
);
}
......@@ -772,7 +784,7 @@ protected function getDisplays() {
$display_entity_type = $this->getDisplayType();
$entity_type = $this->entityManager->getDefinition($display_entity_type);
$config_prefix = $entity_type->getConfigPrefix();
$ids = config_get_storage_names_with_prefix($config_prefix . '.' . $this->entity_type . '.' . $this->bundle . '.');
$ids = $this->configFactory->listAll($config_prefix . '.' . $this->entity_type . '.' . $this->bundle . '.');
foreach ($ids as $id) {
$config_id = str_replace($config_prefix . '.', '', $id);
list(,, $display_mode) = explode('.', $config_id);
......
......@@ -8,6 +8,7 @@
namespace Drupal\field_ui;
use Drupal\Component\Plugin\PluginManagerBase;
use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\Entity\Display\EntityDisplayInterface;
use Drupal\Core\Entity\EntityManagerInterface;
use Drupal\Core\Extension\ModuleHandlerInterface;
......@@ -43,9 +44,11 @@ class FormDisplayOverview extends DisplayOverviewBase {
* The widget or formatter plugin manager.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $module_handler
* The module handler to use for invoking hooks.
* @param \Drupal\Core\Config\ConfigFactory $config_factory
* The configuration factory.
*/
public function __construct(EntityManagerInterface $entity_manager, FieldTypePluginManager $field_type_manager, PluginManagerBase $plugin_manager, ModuleHandlerInterface $module_handler) {
parent::__construct($entity_manager, $field_type_manager, $plugin_manager);
public function __construct(EntityManagerInterface $entity_manager, FieldTypePluginManager $field_type_manager, PluginManagerBase $plugin_manager, ModuleHandlerInterface $module_handler, ConfigFactoryInterface $config_factory) {
parent::__construct($entity_manager, $field_type_manager, $plugin_manager, $config_factory);
$this->moduleHandler = $module_handler;
}
......@@ -57,7 +60,8 @@ public static function create(ContainerInterface $container) {
$container->get('entity.manager'),
$container->get('plugin.manager.field.field_type'),
$container->get('plugin.manager.field.widget'),
$container->get('module_handler')
$container->get('module_handler'),
$container->get('config.factory')
);
}
......
......@@ -100,7 +100,7 @@ function menu_entity_type_build(array &$entity_types) {
*/
function menu_entity_bundle_info() {
$bundles = array();
$config_names = config_get_storage_names_with_prefix('system.menu.');
$config_names = \Drupal::configFactory()->listAll('system.menu.');
foreach ($config_names as $config_name) {
$config = \Drupal::config($config_name);
$bundles['menu_link'][$config->get('id')] = array(
......
......@@ -456,7 +456,7 @@ function node_install() {
*/
function node_uninstall() {
// Delete node type variables.
$types = config_get_storage_names_with_prefix('node.type.');
$types = \Drupal::configFactory()->listAll('node.type.');
foreach ($types as $config_name) {
$type = \Drupal::config($config_name)->get('type');
\Drupal::config('language.settings')->clear('node. ' . $type . '.language.default_configuration')->save();
......
......@@ -343,7 +343,7 @@ function node_type_get_names() {
// Not using node_type_get_types() or entity_load_multiple() here, to allow
// this function being used in hook_entity_type_build() implementations.
// @todo Consider to convert this into a generic config entity helper.
$config_names = config_get_storage_names_with_prefix('node.type.');
$config_names = \Drupal::configFactory()->listAll('node.type.');
$names = array();
foreach ($config_names as $config_name) {
$config = \Drupal::config($config_name);
......@@ -1778,9 +1778,9 @@ function node_modules_installed($modules) {
*/
function node_modules_uninstalled($modules) {
// Remove module-specific settings from all node types.
$config_names = config_get_storage_names_with_prefix('node.type.');
$config_names = \Drupal::configFactory()->listAll('node.type.');
foreach ($config_names as $config_name) {
$config = config($config_name);
$config = \Drupal::config($config_name);
$changed = FALSE;
foreach ($modules as $module) {
if ($config->get('settings.' . $module)) {
......
......@@ -44,7 +44,7 @@ function testMappingCreation() {
// Save bundle mapping config.
rdf_get_mapping($this->entity_type, $this->bundle)->save();
// Test that config file was saved.
$mapping_config = config_get_storage_names_with_prefix('rdf.mapping.');
$mapping_config = \Drupal::configFactory()->listAll('rdf.mapping.');
$this->assertTrue(in_array($mapping_config_name, $mapping_config), 'Rdf mapping config saved.');
}
......
......@@ -58,7 +58,7 @@ public function testDrupalWriteRecord() {
*/
public function testEnableUserTwice() {
\Drupal::moduleHandler()->install(array('user'), FALSE);
$this->assertIdentical(config('system.module')->get('enabled.user'), 0);
$this->assertIdentical(\Drupal::config('system.module')->get('enabled.user'), 0);
}
/**
......
......@@ -137,7 +137,7 @@ function assertModuleConfig($module) {
* TRUE if no configuration was found, FALSE otherwise.
*/
function assertNoModuleConfig($module) {
$names = config_get_storage_names_with_prefix($module . '.');
$names = \Drupal::configFactory()->listAll($module . '.');
return $this->assertFalse($names, format_string('No configuration found for @module module.', array('@module' => $module)));
}
......
......@@ -65,7 +65,7 @@ public function testClear() {
$source .= '[bogus:token]';
// Replace with with the clear parameter, only the valid token should remain.
$target = String::checkPlain(config('system.site')->get('name'));
$target = String::checkPlain(\Drupal::config('system.site')->get('name'));
$result = $this->tokenService->replace($source, array(), array('langcode' => $this->languageInterface->id, 'clear' => TRUE));
$this->assertEqual($target, $result, 'Valid tokens replaced while invalid tokens ignored.');
......
......@@ -43,7 +43,7 @@ function testTemplateSuggestions() {
// Enable test_theme, it contains a template suggested by theme_test.module
// in theme_test_theme_suggestions_theme_test_suggestion_provided().
config('system.theme')
\Drupal::config('system.theme')
->set('default', 'test_theme')
->save();
......@@ -59,7 +59,7 @@ function testGeneralSuggestionsAlter() {
$this->assertText('Original template for testing hook_theme_suggestions_alter().');
// Enable test_theme and test that themes can alter template suggestions.
config('system.theme')
\Drupal::config('system.theme')
->set('default', 'test_theme')
->save();
$this->drupalGet('theme-test/general-suggestion-alter');
......@@ -80,7 +80,7 @@ function testTemplateSuggestionsAlter() {
$this->assertText('Original template for testing hook_theme_suggestions_HOOK_alter().');
// Enable test_theme and test that themes can alter template suggestions.
config('system.theme')
\Drupal::config('system.theme')
->set('default', 'test_theme')
->save();
$this->drupalGet('theme-test/suggestion-alter');
......@@ -101,7 +101,7 @@ function testSpecificSuggestionsAlter() {
$this->drupalGet('theme-test/specific-suggestion-alter');
$this->assertText('Template for testing specific theme calls.');
config('system.theme')
\Drupal::config('system.theme')
->set('default', 'test_theme')
->save();
......@@ -125,7 +125,7 @@ function testThemeFunctionSuggestionsAlter() {
$this->assertText('Original theme function.');
// Enable test_theme and test that themes can alter theme suggestions.
config('system.theme')
\Drupal::config('system.theme')
->set('default', 'test_theme')
->save();
$this->drupalGet('theme-test/function-suggestion-alter');
......@@ -146,7 +146,7 @@ function testThemeFunctionSuggestionsAlter() {
*/
function testExecutionOrder() {
// Enable our test theme and module.
config('system.theme')
\Drupal::config('system.theme')
->set('default', 'test_theme')
->save();
\Drupal::moduleHandler()->install(array('theme_suggestions_test'));
......
......@@ -435,7 +435,7 @@ function taxonomy_vocabulary_get_names() {
if (!isset($names)) {
$names = array();
$config_names = config_get_storage_names_with_prefix('taxonomy.vocabulary.');
$config_names = \Drupal::configFactory()->listAll('taxonomy.vocabulary.');
foreach ($config_names as $config_name) {
$id = substr($config_name, strlen('taxonomy.vocabulary.'));
$names[$id] = $id;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment