$this->
assertSame('config_test.validation',
$typed_config->
getName());
$this->
assertSame('config_test.validation',
$typed_config->
getPropertyPath());
$this->
assertSame('config_test.validation.llama',
$typed_config->
get('llama'
)->
getPropertyPath());
$config_test_entity = \Drupal::
entityTypeManager()->
getStorage('config_test'
)->
create([ 'id' => 'asterix',
'label' => 'Asterix',
'weight' => 11,
'style' => 'test_style',
]);
$typed_config =
$typed_config_manager->
createFromNameAndData($config_test_entity->
getConfigDependencyName(),
$config_test_entity->
toArray());
$this->
assertInstanceOf(TypedConfigInterface::
class,
$typed_config);
$this->
assertEquals(['uuid', 'langcode', 'status', 'dependencies', 'id', 'label', 'weight', 'style', 'size', 'size_value', 'protected_property'
],
array_keys($typed_config->
getElements()));
} /**
* Tests config validation via the Typed Data API.
*/
public function testSimpleConfigValidation() { $config = \Drupal::
configFactory()->
getEditable('config_test.validation'
);
/** @var \Drupal\Core\Config\TypedConfigManagerInterface $typed_config_manager */
$typed_config_manager = \Drupal::
service('config.typed'
);