Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
project
drupal
Commits
d9edc3a2
Commit
d9edc3a2
authored
Aug 04, 2014
by
catch
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2314347
by alexpott: Fixed Remove config.storage dependency from ConfigEntityStorage.
parent
6948f38d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
30 deletions
+14
-30
core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php
core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php
+2
-6
core/modules/field/src/FieldInstanceConfigStorage.php
core/modules/field/src/FieldInstanceConfigStorage.php
+2
-5
core/modules/field/src/FieldStorageConfigStorage.php
core/modules/field/src/FieldStorageConfigStorage.php
+2
-5
core/modules/shortcut/src/ShortcutSetStorage.php
core/modules/shortcut/src/ShortcutSetStorage.php
+2
-3
core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php
...upal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php
+6
-11
No files found.
core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php
View file @
d9edc3a2
...
...
@@ -88,18 +88,15 @@ class ConfigEntityStorage extends EntityStorageBase implements ConfigEntityStora
* The entity type definition.
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory service.
* @param \Drupal\Core\Config\StorageInterface $config_storage
* The config storage service.
* @param \Drupal\Component\Uuid\UuidInterface $uuid_service
* The UUID service.
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
*/
public
function
__construct
(
EntityTypeInterface
$entity_type
,
ConfigFactoryInterface
$config_factory
,
StorageInterface
$config_storage
,
UuidInterface
$uuid_service
,
LanguageManagerInterface
$language_manager
)
{
public
function
__construct
(
EntityTypeInterface
$entity_type
,
ConfigFactoryInterface
$config_factory
,
UuidInterface
$uuid_service
,
LanguageManagerInterface
$language_manager
)
{
parent
::
__construct
(
$entity_type
);
$this
->
configFactory
=
$config_factory
;
$this
->
configStorage
=
$config_storage
;
$this
->
uuidService
=
$uuid_service
;
$this
->
languageManager
=
$language_manager
;
}
...
...
@@ -111,7 +108,6 @@ public static function createInstance(ContainerInterface $container, EntityTypeI
return
new
static
(
$entity_type
,
$container
->
get
(
'config.factory'
),
$container
->
get
(
'config.storage'
),
$container
->
get
(
'uuid'
),
$container
->
get
(
'language_manager'
)
);
...
...
@@ -159,7 +155,7 @@ protected function doLoadMultiple(array $ids = NULL) {
// Get the names of the configuration entities we are going to load.
if
(
$ids
===
NULL
)
{
$names
=
$this
->
config
Storage
->
listAll
(
$prefix
);
$names
=
$this
->
config
Factory
->
listAll
(
$prefix
);
}
else
{
$names
=
array
();
...
...
core/modules/field/src/FieldInstanceConfigStorage.php
View file @
d9edc3a2
...
...
@@ -58,8 +58,6 @@ class FieldInstanceConfigStorage extends ConfigEntityStorage {
* The entity type definition.
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory service.
* @param \Drupal\Core\Config\StorageInterface $config_storage
* The config storage service.
* @param \Drupal\Component\Uuid\UuidInterface $uuid_service
* The UUID service.
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
...
...
@@ -71,8 +69,8 @@ class FieldInstanceConfigStorage extends ConfigEntityStorage {
* @param \Drupal\Component\Plugin\PluginManagerInterface\FieldTypePluginManagerInterface
* The field type plugin manager.
*/
public
function
__construct
(
EntityTypeInterface
$entity_type
,
ConfigFactoryInterface
$config_factory
,
StorageInterface
$config_storage
,
UuidInterface
$uuid_service
,
LanguageManagerInterface
$language_manager
,
EntityManagerInterface
$entity_manager
,
StateInterface
$state
,
FieldTypePluginManagerInterface
$field_type_manager
)
{
parent
::
__construct
(
$entity_type
,
$config_factory
,
$config_storage
,
$uuid_service
,
$language_manager
);
public
function
__construct
(
EntityTypeInterface
$entity_type
,
ConfigFactoryInterface
$config_factory
,
UuidInterface
$uuid_service
,
LanguageManagerInterface
$language_manager
,
EntityManagerInterface
$entity_manager
,
StateInterface
$state
,
FieldTypePluginManagerInterface
$field_type_manager
)
{
parent
::
__construct
(
$entity_type
,
$config_factory
,
$uuid_service
,
$language_manager
);
$this
->
entityManager
=
$entity_manager
;
$this
->
state
=
$state
;
$this
->
fieldTypeManager
=
$field_type_manager
;
...
...
@@ -85,7 +83,6 @@ public static function createInstance(ContainerInterface $container, EntityTypeI
return
new
static
(
$entity_type
,
$container
->
get
(
'config.factory'
),
$container
->
get
(
'config.storage'
),
$container
->
get
(
'uuid'
),
$container
->
get
(
'language_manager'
),
$container
->
get
(
'entity.manager'
),
...
...
core/modules/field/src/FieldStorageConfigStorage.php
View file @
d9edc3a2
...
...
@@ -60,8 +60,6 @@ class FieldStorageConfigStorage extends ConfigEntityStorage {
* The entity type definition.
* @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
* The config factory service.
* @param \Drupal\Core\Config\StorageInterface $config_storage
* The config storage service.
* @param \Drupal\Component\Uuid\UuidInterface $uuid_service
* The UUID service.
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
...
...
@@ -75,8 +73,8 @@ class FieldStorageConfigStorage extends ConfigEntityStorage {
* @param \Drupal\Component\Plugin\PluginManagerInterface\FieldTypePluginManagerInterface
* The field type plugin manager.
*/
public
function
__construct
(
EntityTypeInterface
$entity_type
,
ConfigFactoryInterface
$config_factory
,
StorageInterface
$config_storage
,
UuidInterface
$uuid_service
,
LanguageManagerInterface
$language_manager
,
EntityManagerInterface
$entity_manager
,
ModuleHandler
$module_handler
,
StateInterface
$state
,
FieldTypePluginManagerInterface
$field_type_manager
)
{
parent
::
__construct
(
$entity_type
,
$config_factory
,
$config_storage
,
$uuid_service
,
$language_manager
);
public
function
__construct
(
EntityTypeInterface
$entity_type
,
ConfigFactoryInterface
$config_factory
,
UuidInterface
$uuid_service
,
LanguageManagerInterface
$language_manager
,
EntityManagerInterface
$entity_manager
,
ModuleHandler
$module_handler
,
StateInterface
$state
,
FieldTypePluginManagerInterface
$field_type_manager
)
{
parent
::
__construct
(
$entity_type
,
$config_factory
,
$uuid_service
,
$language_manager
);
$this
->
entityManager
=
$entity_manager
;
$this
->
moduleHandler
=
$module_handler
;
$this
->
state
=
$state
;
...
...
@@ -90,7 +88,6 @@ public static function createInstance(ContainerInterface $container, EntityTypeI
return
new
static
(
$entity_type
,
$container
->
get
(
'config.factory'
),
$container
->
get
(
'config.storage'
),
$container
->
get
(
'uuid'
),
$container
->
get
(
'language_manager'
),
$container
->
get
(
'entity.manager'
),
...
...
core/modules/shortcut/src/ShortcutSetStorage.php
View file @
d9edc3a2
...
...
@@ -45,8 +45,8 @@ class ShortcutSetStorage extends ConfigEntityStorage implements ShortcutSetStora
* @param \Drupal\Core\Language\LanguageManagerInterface $language_manager
* The language manager.
*/
public
function
__construct
(
EntityTypeInterface
$entity_info
,
ConfigFactoryInterface
$config_factory
,
StorageInterface
$config_storage
,
UuidInterface
$uuid_service
,
ModuleHandlerInterface
$module_handler
,
LanguageManagerInterface
$language_manager
)
{
parent
::
__construct
(
$entity_info
,
$config_factory
,
$config_storage
,
$uuid_service
,
$language_manager
);
public
function
__construct
(
EntityTypeInterface
$entity_info
,
ConfigFactoryInterface
$config_factory
,
UuidInterface
$uuid_service
,
ModuleHandlerInterface
$module_handler
,
LanguageManagerInterface
$language_manager
)
{
parent
::
__construct
(
$entity_info
,
$config_factory
,
$uuid_service
,
$language_manager
);
$this
->
moduleHandler
=
$module_handler
;
}
...
...
@@ -58,7 +58,6 @@ public static function createInstance(ContainerInterface $container, EntityTypeI
return
new
static
(
$entity_info
,
$container
->
get
(
'config.factory'
),
$container
->
get
(
'config.storage'
),
$container
->
get
(
'uuid'
),
$container
->
get
(
'module_handler'
),
$container
->
get
(
'language_manager'
)
...
...
core/tests/Drupal/Tests/Core/Config/Entity/ConfigEntityStorageTest.php
View file @
d9edc3a2
...
...
@@ -68,13 +68,6 @@ class ConfigEntityStorageTest extends UnitTestCase {
*/
protected
$configFactory
;
/**
* The config storage service.
*
* @var \Drupal\Core\Config\StorageInterface|\PHPUnit_Framework_MockObject_MockObject
*/
protected
$configStorage
;
/**
* The entity query.
*
...
...
@@ -139,14 +132,12 @@ protected function setUp() {
->
method
(
'getDefaultLanguage'
)
->
will
(
$this
->
returnValue
(
new
Language
(
array
(
'langcode'
=>
'en'
))));
$this
->
configStorage
=
$this
->
getConfigStorageStub
(
array
());
$this
->
configFactory
=
$this
->
getMock
(
'Drupal\Core\Config\ConfigFactoryInterface'
);
$this
->
entityQuery
=
$this
->
getMock
(
'Drupal\Core\Entity\Query\QueryInterface'
);
$this
->
entityStorage
=
$this
->
getMockBuilder
(
'Drupal\Core\Config\Entity\ConfigEntityStorage'
)
->
setConstructorArgs
(
array
(
$this
->
entityType
,
$this
->
configFactory
,
$this
->
configStorage
,
$this
->
uuidService
,
$this
->
languageManager
))
->
setConstructorArgs
(
array
(
$this
->
entityType
,
$this
->
configFactory
,
$this
->
uuidService
,
$this
->
languageManager
))
->
setMethods
(
array
(
'getQuery'
))
->
getMock
();
$this
->
entityStorage
->
expects
(
$this
->
any
())
...
...
@@ -641,9 +632,13 @@ public function testLoadMultipleAll() {
array
(
'id'
,
'bar'
),
)));
$this
->
configFactory
->
expects
(
$this
->
once
())
->
method
(
'listAll'
)
->
with
(
'the_config_prefix.'
)
->
will
(
$this
->
returnValue
(
array
(
'the_config_prefix.foo'
,
'the_config_prefix.bar'
)));
$this
->
configFactory
->
expects
(
$this
->
once
())
->
method
(
'loadMultiple'
)
->
with
(
array
())
->
with
(
array
(
'the_config_prefix.foo'
,
'the_config_prefix.bar'
))
->
will
(
$this
->
returnValue
(
array
(
$foo_config_object
,
$bar_config_object
)));
$this
->
moduleHandler
->
expects
(
$this
->
exactly
(
2
))
->
method
(
'getImplementations'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment