function BlockValidationTest::testRequiredPropertyValuesMissing
Same name and namespace in other branches
- 11.x core/modules/block/tests/src/Kernel/BlockValidationTest.php \Drupal\Tests\block\Kernel\BlockValidationTest::testRequiredPropertyValuesMissing()
A property that is required must have a value (i.e. not NULL).
@todo Remove this optional parameter in https://www.drupal.org/project/drupal/issues/2820364#comment-15333069
Parameters
array<string, array<string, list<string>|string>>|null $additional_expected_validation_errors_when_missing: Some required config entity properties have additional validation constraints that cause additional messages to appear. Keys must be config entity properties, values must be arrays as expected by ::assertValidationErrors().
Return value
void No return value.
Overrides ConfigEntityValidationTestBase::testRequiredPropertyValuesMissing
File
-
core/
modules/ block/ tests/ src/ Kernel/ BlockValidationTest.php, line 140
Class
- BlockValidationTest
- Tests validation of block entities.
Namespace
Drupal\Tests\block\KernelCode
public function testRequiredPropertyValuesMissing(?array $additional_expected_validation_errors_when_missing = NULL) : void {
parent::testRequiredPropertyValuesMissing([
'region' => [
'region' => [
'This value should not be blank.',
'This value should not be null.',
],
],
'theme' => [
'region' => 'This block does not say which theme it appears in.',
],
]);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.