function EntityTestHalJsonInternalPropertyNormalizerTest::getExpectedNormalizedEntity
Overrides EntityTestHalJsonAnonTest::getExpectedNormalizedEntity
File
-
core/
modules/ hal/ tests/ src/ Functional/ entity_test/ EntityTestHalJsonInternalPropertyNormalizerTest.php, line 34
Class
- EntityTestHalJsonInternalPropertyNormalizerTest
- Test that internal properties are not exposed in the 'hal_json' format.
Namespace
Drupal\Tests\hal\Functional\entity_testCode
protected function getExpectedNormalizedEntity() {
$default_normalization = parent::getExpectedNormalizedEntity();
$normalization = $this->applyHalFieldNormalization($default_normalization);
// The 'internal_value' property in test field type will not be returned in
// normalization because setInternal(FALSE) was not called for this
// property.
// @see \Drupal\entity_test\Plugin\Field\FieldType\InternalPropertyTestFieldItem::propertyDefinitions
$normalization['field_test_internal'] = [
[
'value' => 'This value shall not be internal!',
'non_internal_value' => 'Computed! This value shall not be internal!',
],
];
return $normalization;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.