Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
drupal
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
drupal
Merge requests
!11244
An error occurred while fetching the assigned milestone of the selected merge_request.
Issue
#2205797
: Create unit test for ConfigManager()->getEntityTypeByIdName()
Code
Review changes
Check out branch
Download
Patches
Plain diff
Open
Issue
#2205797
: Create unit test for ConfigManager()->getEntityTypeByIdName()
issue/drupal-2205797:2205797-create-unit-test
into
11.x
Overview
0
Commits
2
Pipelines
2
Changes
1
Open
Riyas N R
requested to merge
issue/drupal-2205797:2205797-create-unit-test
into
11.x
3 months ago
Overview
0
Commits
2
Pipelines
2
Changes
1
Expand
Closes
#2205797
0
0
Merge request reports
Compare
11.x
version 1
3c465879
3 months ago
11.x (HEAD)
and
latest version
latest version
4f22dbc9
2 commits,
3 months ago
version 1
3c465879
1 commit,
3 months ago
1 file
+
27
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
core/tests/Drupal/KernelTests/Core/Config/ConfigDependencyTest.php
+
27
−
0
Options
@@ -709,4 +709,31 @@ protected function getDependentIds(array $dependents): array {
return
$dependent_ids
;
}
/**
* @covers ::getEntityTypeIdByName
*/
public
function
testGetEntityTypeIdByName
():
void
{
/** @var \Drupal\Core\Config\ConfigManagerInterface $config_manager */
$config_manager
=
\Drupal
::
service
(
'config.manager'
);
/** @var \Drupal\Core\Config\Entity\ConfigEntityStorage $storage */
$storage
=
$this
->
container
->
get
(
'entity_type.manager'
)
->
getStorage
(
'config_test'
);
$entity_1
=
$storage
->
create
(
[
'id'
=>
'entity_1'
,
]
);
$entity_1
->
save
();
// Test for config entity with type.
// Do a dry run using.
// \Drupal\Core\Config\ConfigManager::getEntityTypeIdByName().
$config_entities
=
$config_manager
->
getEntityTypeIdByName
(
$entity_1
->
getConfigDependencyName
());
$this
->
assertEquals
(
'config_test'
,
$config_entities
,
'Entity type id is correct.'
);
// Test for simple config.
$this
->
assertNull
(
$config_manager
->
getEntityTypeIdByName
(
'system.site'
),
'No entity type ID should be returned for system.site.'
);
}
}
Loading