Provides an array of suitable property values for an entity type.
Required properties differ from entity type to entity type, so we keep a minimum mapping here.
string $entity_type: The type of the entity that should be created.
array An array of values keyed by property name.
protected function entityValues($entity_type) {
switch ($entity_type) {
case 'entity_test':
return array(
'name' => $this
->randomName(),
'user_id' => 1,
'field_test_text' => array(
0 => array(
'value' => $this
->randomString(),
),
),
);
case 'node':
return array(
'title' => $this
->randomString(),
'type' => $this
->randomString(),
);
case 'user':
return array(
'name' => $this
->randomName(),
);
default:
return array();
}
}