function ConfigSchemaTest::testLangcodeRequiredIfTranslatableValuesConstraintError
Same name in other branches
- 10 core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php \Drupal\KernelTests\Core\Config\ConfigSchemaTest::testLangcodeRequiredIfTranslatableValuesConstraintError()
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Config/ ConfigSchemaTest.php, line 860
Class
- ConfigSchemaTest
- Tests schema for configuration objects.
Namespace
Drupal\KernelTests\Core\ConfigCode
public function testLangcodeRequiredIfTranslatableValuesConstraintError() : void {
$config = \Drupal::configFactory()->getEditable('config_test.foo');
$this->expectException(\LogicException::class);
$this->expectExceptionMessage('The LangcodeRequiredIfTranslatableValues constraint is applied to \'config_test.foo::broken_langcode_required\'. This constraint can only operate on the root object being validated.');
$config->set('broken_langcode_required.foo', 'bar')
->save();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.