Executes the data structure interfaces tests for the given entity type.
string $entity_type: The entity type to run the tests with.
protected function assertDataStructureInterfaces($entity_type) {
$entity = $this
->createTestEntity($entity_type);
$entity
->save();
$entity_definition = array(
'type' => 'entity',
'constraints' => array(
'EntityType' => $entity_type,
),
'label' => 'Test entity',
);
$wrapped_entity = $this->container
->get('typed_data')
->create($entity_definition, $entity);
// Test using the whole tree of typed data by navigating through the tree of
// contained properties and getting all contained strings, limited by a
// certain depth.
$strings = array();
$this
->getContainedStrings($wrapped_entity, 0, $strings);
// @todo: Once the user entity has defined properties this should contain
// the user name and other user entity strings as well.
$target_strings = array(
$entity->uuid->value,
Language::LANGCODE_NOT_SPECIFIED,
$this->entity_name,
// Bundle name.
$entity
->bundle(),
$this->entity_field_text,
// Field format.
NULL,
);
$this
->assertEqual($strings, $target_strings, format_string('%entity_type: All contained strings found.', array(
'%entity_type' => $entity_type,
)));
}