Commit dca2d601 authored by webchick's avatar webchick

Issue #1857442 by longwave, dawehner: Make $values optional on entity_create.

parent f6dd96ca
......@@ -377,16 +377,16 @@ function entity_delete_multiple($entity_type, array $ids) {
/**
* Constructs a new entity object, without permanently saving it.
*
* @param $entity_type
* @param string $entity_type
* The type of the entity.
* @param $values
* An array of values to set, keyed by property name. If the entity type has
* bundles the bundle key has to be specified.
* @param array $values
* (optional) An array of values to set, keyed by property name. If the
* entity type has bundles, the bundle key has to be specified.
*
* @return \Drupal\Core\Entity\EntityInterface
* A new entity object.
*/
function entity_create($entity_type, array $values) {
function entity_create($entity_type, array $values = array()) {
return \Drupal::entityManager()
->getStorageController($entity_type)
->create($values);
......
......@@ -248,7 +248,7 @@ protected function buildQuery($ids, $revision_id = FALSE) {
/**
* Implements Drupal\Core\Entity\EntityStorageControllerInterface::create().
*/
public function create(array $values) {
public function create(array $values = array()) {
$class = $this->entityType->getClass();
$class::preCreate($this, $values);
......
......@@ -235,7 +235,7 @@ protected function buildQuery($ids, $revision_id = FALSE) {
/**
* {@inheritdoc}
*/
public function create(array $values) {
public function create(array $values = array()) {
$entity_class = $this->entityType->getClass();
$entity_class::preCreate($this, $values);
......
......@@ -111,14 +111,14 @@ public function loadByProperties(array $values = array());
/**
* Constructs a new entity object, without permanently saving it.
*
* @param $values
* An array of values to set, keyed by property name. If the entity type has
* bundles the bundle key has to be specified.
* @param array $values
* (optional) An array of values to set, keyed by property name. If the
* entity type has bundles, the bundle key has to be specified.
*
* @return \Drupal\Core\Entity\EntityInterface
* A new entity object.
*/
public function create(array $values);
public function create(array $values = array());
/**
* Deletes permanently saved entities.
......
......@@ -55,7 +55,7 @@ public static function createInstance(ContainerInterface $container, EntityTypeI
/**
* {@inheritdoc}
*/
public function create(array $values) {
public function create(array $values = array()) {
$entity_class = $this->entityType->getClass();
$entity_class::preCreate($this, $values);
......
......@@ -61,7 +61,7 @@ protected function defineOptions() {
*/
public function render(ResultRow $values) {
if (!empty($this->options['link_to_user'])) {
$account = entity_create('user', array());
$account = entity_create('user');
$account->name = $this->getValue($values);
$account->uid = $values->{$this->uid};
$username = array(
......
......@@ -61,7 +61,7 @@ public function buildOptionsForm(&$form, &$form_state) {
*/
protected function renderLink($data, ResultRow $values) {
if (!empty($this->options['link_to_user'])) {
$account = entity_create('user', array());
$account = entity_create('user');
$account->uid = $this->getValue($values, 'uid');
$account->name = $this->getValue($values);
$account->homepage = $this->getValue($values, 'homepage');
......
......@@ -38,7 +38,7 @@ public static function getInfo() {
function testCRUD() {
$default_langcode = language_default()->id;
// Verify default properties on a newly created empty entity.
$empty = entity_create('config_test', array());
$empty = entity_create('config_test');
$this->assertIdentical($empty->id, NULL);
$this->assertTrue($empty->uuid);
$this->assertIdentical($empty->label, NULL);
......
......@@ -58,7 +58,7 @@ public function setUp() {
*/
public function testDateTimeItem() {
// Verify entity creation.
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
$value = '2014-01-01T20:00:00Z';
$entity->field_datetime = $value;
$entity->name->value = $this->randomName();
......@@ -88,7 +88,7 @@ public function testDateTimeItem() {
*/
public function testSetValue() {
// Test DateTimeItem::setValue() using string.
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
$value = '2014-01-01T20:00:00Z';
$entity->get('field_datetime')->set(0, $value);
$entity->save();
......@@ -98,7 +98,7 @@ public function testSetValue() {
$this->assertEqual($entity->field_datetime[0]->value, $value, 'DateTimeItem::setValue() works with string value.');
// Test DateTimeItem::setValue() using property array.
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
$value = '2014-01-01T20:00:00Z';
$entity->set('field_datetime', $value);
$entity->save();
......@@ -113,7 +113,7 @@ public function testSetValue() {
*/
public function testSetValueProperty() {
// Test Date::setValue().
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
$value = '2014-01-01T20:00:00Z';
$entity->set('field_datetime', $value);
......
......@@ -74,7 +74,7 @@ public function testText() {
);
// Create an entity with values for this text field.
$this->entity = entity_create('entity_test', array());
$this->entity = entity_create('entity_test');
$this->entity->{$field_name}->value = 'Hello, world!';
$this->entity->{$field_name}->format = 'full_html';
$this->entity->save();
......@@ -126,7 +126,7 @@ public function testTextWysiwyg() {
);
// Create an entity with values for this text field.
$this->entity = entity_create('entity_test', array());
$this->entity = entity_create('entity_test');
$this->entity->{$field_name}->value = 'Hello, world!';
$this->entity->{$field_name}->format = 'filtered_html';
$this->entity->save();
......@@ -163,7 +163,7 @@ public function testNumber() {
);
// Create an entity with values for this text field.
$this->entity = entity_create('entity_test', array());
$this->entity = entity_create('entity_test');
$this->entity->{$field_name}->value = 42;
$this->entity->save();
......
......@@ -95,7 +95,7 @@ public function testSimpleEntityType() {
);
// Create an entity with values for this text field.
$this->entity = entity_create('entity_test', array());
$this->entity = entity_create('entity_test');
$this->entity->{$field_1_name}->value = 'Test';
$this->entity->{$field_2_name}->value = 42;
$this->entity->save();
......@@ -161,7 +161,7 @@ public function testEditorWithCustomMetadata() {
$full_html_format->save();
// Create an entity with values for this rich text field.
$this->entity = entity_create('entity_test', array());
$this->entity = entity_create('entity_test');
$this->entity->{$field_name}->value = 'Test';
$this->entity->{$field_name}->format = 'full_html';
$this->entity->save();
......
......@@ -127,7 +127,7 @@ public function testEditorSelection() {
$this->editorSelector = new EditorSelector($this->editorManager, $this->container->get('plugin.manager.field.formatter'));
// Create an entity with values for this text field.
$this->entity = entity_create('entity_test', array());
$this->entity = entity_create('entity_test');
$this->entity->{$this->field_name}->value = 'Hello, world!';
$this->entity->{$this->field_name}->format = 'filtered_html';
$this->entity->save();
......@@ -156,7 +156,7 @@ public function testMetadata() {
$this->metadataGenerator = new MetadataGenerator($this->accessChecker, $this->editorSelector, $this->editorManager);
// Create an entity with values for the field.
$this->entity = entity_create('entity_test', array());
$this->entity = entity_create('entity_test');
$this->entity->{$this->field_name}->value = 'Test';
$this->entity->{$this->field_name}->format = 'full_html';
$this->entity->save();
......@@ -183,7 +183,7 @@ public function testMetadata() {
*/
public function testGetUntransformedTextCommand() {
// Create an entity with values for the field.
$this->entity = entity_create('entity_test', array());
$this->entity = entity_create('entity_test');
$this->entity->{$this->field_name}->value = 'Test';
$this->entity->{$this->field_name}->format = 'full_html';
$this->entity->save();
......
......@@ -59,7 +59,7 @@ public function setUp() {
* Tests the configurable text editor manager.
*/
public function testEditorEntityHooks() {
$image = entity_create('file', array());
$image = entity_create('file');
$image->setFileUri('core/misc/druplicon.png');
$image->setFilename(drupal_basename($image->getFileUri()));
$image->save();
......
......@@ -59,7 +59,7 @@ public function setUp() {
*/
public function testEmailItem() {
// Verify entity creation.
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
$value = 'test@example.com';
$entity->field_email = $value;
$entity->name->value = $this->randomName();
......
......@@ -81,7 +81,7 @@ public function testContentEntityReferenceItem() {
$tid = $this->term->id();
// Just being able to create the entity like this verifies a lot of code.
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
$entity->field_test_taxonomy_term->target_id = $tid;
$entity->name->value = $this->randomName();
$entity->save();
......@@ -128,7 +128,7 @@ public function testConfigEntityReferenceItem() {
$referenced_entity_id = $this->vocabulary->id();
// Just being able to create the entity like this verifies a lot of code.
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
$entity->field_test_taxonomy_vocabulary->target_id = $referenced_entity_id;
$entity->name->value = $this->randomName();
$entity->save();
......
......@@ -348,7 +348,7 @@ function testDeleteField() {
$this->assertTrue(!empty($instance) && empty($instance->deleted), 'A new instance for a previously used field name is created.');
// Save an entity with data for the field
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
$values[0]['value'] = mt_rand(1, 127);
$entity->{$field->getName()}->value = $values[0]['value'];
$entity = $this->entitySaveReload($entity);
......@@ -402,7 +402,7 @@ function testUpdateField() {
$instance->save();
do {
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
// Fill in the entity with more values than $cardinality.
for ($i = 0; $i < 20; $i++) {
// We can not use $i here because 0 values are filtered out.
......
......@@ -110,7 +110,7 @@ function setUp() {
// Create an entity with values.
$this->values = $this->_generateTestFieldValues($this->cardinality);
$this->entity = entity_create('entity_test', array());
$this->entity = entity_create('entity_test');
$this->entity->{$this->field_name}->setValue($this->values);
$this->entity->save();
}
......
......@@ -48,7 +48,7 @@ function testFieldAttachView() {
$this->createFieldWithInstance('_2');
$entity_type = 'entity_test';
$entity_init = entity_create($entity_type, array());
$entity_init = entity_create($entity_type);
// Populate values to be displayed.
$values = $this->_generateTestFieldValues($this->field->getCardinality());
......
......@@ -58,7 +58,7 @@ function testFieldAttachSaveLoad() {
// TODO : test empty values filtering and "compression" (store consecutive deltas).
// Preparation: create three revisions and store them in $revision array.
$values = array();
$entity = entity_create($entity_type, array());
$entity = entity_create($entity_type);
for ($revision_id = 0; $revision_id < 3; $revision_id++) {
// Note: we try to insert one extra value.
$current_values = $this->_generateTestFieldValues($cardinality + 1);
......
......@@ -60,7 +60,7 @@ public function setUp() {
*/
public function testShapeItem() {
// Verify entity creation.
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
$shape = 'cube';
$color = 'blue';
$entity->{$this->field_name}->shape = $shape;
......
......@@ -61,7 +61,7 @@ public function setUp() {
*/
public function testTestItem() {
// Verify entity creation.
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
$value = rand(1, 10);
$entity->field_test = $value;
$entity->name->value = $this->randomName();
......
......@@ -102,7 +102,7 @@ function testFieldFormTranslationRevisions() {
// Prepare the field translations.
field_test_entity_info_translatable($this->entity_type, TRUE);
$entity = entity_create($this->entity_type, array());
$entity = entity_create($this->entity_type);
$available_langcodes = array_flip(array_keys(language_list()));
$field_name = $this->field->getName();
......
......@@ -68,7 +68,7 @@ public function setUp() {
*/
public function testFileItem() {
// Create a test entity with the
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
$entity->file_test->target_id = $this->file->id();
$entity->file_test->display = 1;
$entity->file_test->description = $description = $this->randomName();
......
......@@ -22,11 +22,11 @@ public static function getInfo() {
function setUp() {
parent::setUp();
$this->image = entity_create('file', array());
$this->image = entity_create('file');
$this->image->setFileUri('core/misc/druplicon.png');
$this->image->setFilename(drupal_basename($this->image->getFileUri()));
$this->non_image = entity_create('file', array());
$this->non_image = entity_create('file');
$this->non_image->setFileUri('core/assets/vendor/jquery/jquery.js');
$this->non_image->setFilename(drupal_basename($this->non_image->getFileUri()));
}
......@@ -105,7 +105,7 @@ function testFileValidateImageResolution() {
*/
function testFileValidateNameLength() {
// Create a new file entity.
$file = entity_create('file', array());
$file = entity_create('file');
// Add a filename with an allowed length and test it.
$file->setFilename(str_repeat('x', 240));
......
......@@ -34,14 +34,14 @@ public static function getInfo() {
*/
function testTextFormatCrud() {
// Add a text format with minimum data only.
$format = entity_create('filter_format', array());
$format = entity_create('filter_format');
$format->format = 'empty_format';
$format->name = 'Empty format';
$format->save();
$this->verifyTextFormat($format);
// Add another text format specifying all possible properties.
$format = entity_create('filter_format', array());
$format = entity_create('filter_format');
$format->format = 'custom_format';
$format->name = 'Custom format';
$format->setFilterConfig('filter_url', array(
......
......@@ -73,7 +73,7 @@ public function setUp() {
*/
public function testImageItem() {
// Create a test entity with the image field set.
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
$entity->image_test->target_id = $this->image->id();
$entity->image_test->alt = $alt = $this->randomName();
$entity->image_test->title = $title = $this->randomName();
......
......@@ -79,7 +79,7 @@ function testImageFormatterTheme() {
$url = $style->buildUrl($original_uri);
// Create a test entity with the image field set.
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
$entity->image_test->target_id = $this->image->id();
$entity->image_test->alt = NULL;
$entity->image_test->uri = $original_uri;
......
......@@ -52,7 +52,7 @@ public function setUp() {
*/
public function testLinkItem() {
// Create entity.
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
$url = 'http://www.drupal.org';
$title = $this->randomName();
$class = $this->randomName();
......
......@@ -71,7 +71,7 @@ public function __construct(EntityTypeInterface $entity_info, Connection $databa
/**
* {@inheritdoc}
*/
public function create(array $values) {
public function create(array $values = array()) {
// The bundle of menu links being the menu name is not enforced but is the
// default behavior if no bundle is set.
if (!isset($values['bundle']) && isset($values['menu_name'])) {
......
......@@ -54,7 +54,7 @@ public function setUp() {
*/
public function testNumberItem() {
// Verify entity creation.
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
$integer = rand(0, 10);
$entity->field_integer = $integer;
$float = 3.14;
......
......@@ -34,7 +34,7 @@ public static function getInfo() {
*/
function testUpdateAllowedValues() {
// All three options appear.
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
$form = \Drupal::entityManager()->getForm($entity);
$this->assertTrue(!empty($form[$this->fieldName]['widget'][1]), 'Option 1 exists');
$this->assertTrue(!empty($form[$this->fieldName]['widget'][2]), 'Option 2 exists');
......@@ -42,7 +42,7 @@ function testUpdateAllowedValues() {
// Use one of the values in an actual entity, and check that this value
// cannot be removed from the list.
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
$entity->{$this->fieldName}->value = 1;
$entity->save();
$this->field->settings['allowed_values'] = array(2 => 'Two');
......@@ -60,7 +60,7 @@ function testUpdateAllowedValues() {
// Removed options do not appear.
$this->field->settings['allowed_values'] = array(2 => 'Two');
$this->field->save();
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
$form = \Drupal::entityManager()->getForm($entity);
$this->assertTrue(empty($form[$this->fieldName]['widget'][1]), 'Option 1 does not exist');
$this->assertTrue(!empty($form[$this->fieldName]['widget'][2]), 'Option 2 exists');
......@@ -71,7 +71,7 @@ function testUpdateAllowedValues() {
$this->field->save();
// The entity holds an outdated field object with the old allowed values
// setting, so we need to reintialize the entity object.
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
$form = \Drupal::entityManager()->getForm($entity);
$this->assertTrue(empty($form[$this->fieldName]['widget'][1]), 'Option 1 does not exist');
$this->assertTrue(empty($form[$this->fieldName]['widget'][2]), 'Option 2 does not exist');
......@@ -92,7 +92,7 @@ function testUpdateAllowedValues() {
'type' => 'options_buttons',
))
->save();
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
$form = \Drupal::entityManager()->getForm($entity);
$this->assertTrue(!empty($form[$this->fieldName]['widget'][1]), 'Option 1 exists');
$this->assertTrue(!empty($form[$this->fieldName]['widget'][2]), 'Option 2 exists');
......
......@@ -34,7 +34,7 @@ public function setUp() {
* Tests the formatters.
*/
public function testFormatter() {
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
$entity->{$this->fieldName}->value = 1;
$build = field_view_field($entity, $this->fieldName, array());
......
......@@ -45,7 +45,7 @@ public function setUp() {
// Set up test values.
$this->test_value = $this->randomName();
$this->entity = entity_create('entity_test', array());
$this->entity = entity_create('entity_test');
$this->entity->{$this->fieldName}->value = $this->test_value;
$this->entity->save();
......
......@@ -93,7 +93,7 @@ public function setUp() {
))->save();
// Set up test values.
$this->entity = entity_create('entity_test', array());
$this->entity = entity_create('entity_test');
$this->entity->{$this->fieldName}->target_id = $this->term->id();
$this->entity->save();
$this->uri = $this->getAbsoluteUri($this->entity);
......
......@@ -57,7 +57,7 @@ public function setUp() {
))->save();
// Set up test entity.
$this->entity = entity_create('entity_test', array());
$this->entity = entity_create('entity_test');
$this->entity->{$this->fieldName}->value = $this->testValue;
$this->entity->{$this->fieldName}->summary = $this->testSummary;
}
......
......@@ -86,7 +86,7 @@ function testEntityAccessDefaultController() {
$controller = $this->container->get('entity.manager')->getAccessController('entity_test_default_access');
$this->assertTrue($controller instanceof EntityAccessController, 'The default entity controller is used for the entity_test_default_access entity type.');
$entity = entity_create('entity_test_default_access', array());
$entity = entity_create('entity_test_default_access');
$this->assertEntityAccess(array(
'create' => FALSE,
'update' => FALSE,
......
......@@ -54,7 +54,7 @@ public function testDefaultValues() {
* The entity type to run the tests with.
*/
protected function assertDefaultValues($entity_type) {
$entity = entity_create($entity_type, array());
$entity = entity_create($entity_type);
$this->assertEqual($entity->langcode->value, Language::LANGCODE_NOT_SPECIFIED, String::format('%entity_type: Default language', array('%entity_type' => $entity_type)));
$this->assertTrue(Uuid::isValid($entity->uuid->value), String::format('%entity_type: Default UUID', array('%entity_type' => $entity_type)));
$this->assertEqual($entity->name->getValue(), array(0 => array('value' => NULL)), 'Field has one empty value by default.');
......
......@@ -70,7 +70,7 @@ protected function createTestEntity($entity_type) {
// Pass in the value of the name field when creating. With the user
// field we test setting a field after creation.
$entity = entity_create($entity_type, array());
$entity = entity_create($entity_type);
$entity->user_id->target_id = $this->entity_user->id();
$entity->name->value = $this->entity_name;
......@@ -362,7 +362,7 @@ protected function checkIntrospection($entity_type) {
// Test introspecting an entity object.
// @todo: Add bundles and test bundles as well.
$entity = entity_create($entity_type, array());
$entity = entity_create($entity_type);
$definitions = $entity->getPropertyDefinitions();
$this->assertEqual($definitions['name']->getType(), 'string', $entity_type .': Name field found.');
......
......@@ -72,7 +72,7 @@ protected function createTestEntity($entity_type) {
// Pass in the value of the name field when creating. With the user
// field we test setting a field after creation.
$entity = entity_create($entity_type, array());
$entity = entity_create($entity_type);
$entity->user_id->target_id = $this->entity_user->id();
$entity->name->value = $this->entity_name;
......
......@@ -80,7 +80,7 @@ public function testFieldItemAttributes() {
// Create an entity and save test value in field_test_text.
$test_value = $this->randomName();
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
$entity->field_test_text = $test_value;
$entity->save();
......
......@@ -100,7 +100,7 @@ function testFieldLoad() {
// Create an entity with four revisions.
$revision_ids = array();
$entity = entity_create($entity_type, array());
$entity = entity_create($entity_type);
$entity->save();
$revision_ids[] = $entity->getRevisionId();
for ($i = 0; $i < 4; $i++) {
......@@ -166,7 +166,7 @@ function testFieldLoad() {
*/
function testFieldWrite() {
$entity_type = $bundle = 'entity_test_rev';
$entity = entity_create($entity_type, array());
$entity = entity_create($entity_type);
$revision_values = array();
......
......@@ -286,7 +286,7 @@ function entity_test_form_node_form_alter(&$form, &$form_state, $form_id) {
*/
function entity_test_add($entity_type) {
drupal_set_title(t('Create an @type', array('@type' => $entity_type)));
$entity = entity_create($entity_type, array());
$entity = entity_create($entity_type);
return \Drupal::entityManager()->getForm($entity);
}
......
......@@ -23,7 +23,7 @@ class TermStorageController extends FieldableDatabaseStorageController implement
* An array of values to set, keyed by property name. A value for the
* vocabulary ID ('vid') is required.
*/
public function create(array $values) {
public function create(array $values = array()) {
// Save new terms with no parents by default.
if (empty($values['parent'])) {
$values['parent'] = array(0);
......
......@@ -78,7 +78,7 @@ public function setUp() {
public function testTaxonomyTermReferenceItem() {
$tid = $this->term->id();
// Just being able to create the entity like this verifies a lot of code.
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
$entity->field_test_taxonomy->target_id = $this->term->id();
$entity->name->value = $this->randomName();
$entity->save();
......
......@@ -80,14 +80,14 @@ function setUp() {
function testTaxonomyTermFieldValidation() {
// Test validation with a valid value.
$term = $this->createTerm($this->vocabulary);
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
$entity->{$this->field_name}->target_id = $term->id();
$violations = $entity->{$this->field_name}->validate();
$this->assertEqual(count($violations) , 0, 'Correct term does not cause validation error.');
// Test validation with an invalid valid value (wrong vocabulary).
$bad_term = $this->createTerm($this->createVocabulary());
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
$entity->{$this->field_name}->target_id = $bad_term->id();
$violations = $entity->{$this->field_name}->validate();
$this->assertEqual(count($violations) , 1, 'Wrong term causes validation error.');
......
......@@ -52,7 +52,7 @@ public function setUp() {
*/
public function testTestItem() {
// Verify entity creation.
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
$value = '+0123456789';
$entity->field_test = $value;
$entity->name->value = $this->randomName();
......
......@@ -64,7 +64,7 @@ function testTextFieldValidation() {
))->save();
// Test validation with valid and invalid values.
$entity = entity_create('entity_test', array());
$entity = entity_create('entity_test');
for ($i = 0; $i <= $max_length + 2; $i++) {
$entity->{$this->field->name}->value = str_repeat('x', $i);
$violations = $entity->{$this->field->name}->validate();
......
......@@ -68,7 +68,7 @@ public function testCrudAndUpdate() {
$this->createField($entity_type);
// Create an entity with a summary and no text format.
$entity = entity_create($entity_type, array());
$entity = entity_create($entity_type);
$entity->summary_field->value = $value = $this->randomName();
$entity->summary_field->summary = $summary = $this->randomName();
$entity->summary_field->format = NULL;
......@@ -112,7 +112,7 @@ function testProcessedCache() {
$this->createField($entity_type);