Commit 42024826 authored by alexpott's avatar alexpott

Issue #2344821 by yched: Unify 'name' / 'field_name' in FieldConfig / FieldStorageConfig.

parent 035393d8
...@@ -81,7 +81,7 @@ function block_content_add_body_field($block_type_id, $label = 'Body') { ...@@ -81,7 +81,7 @@ function block_content_add_body_field($block_type_id, $label = 'Body') {
$field = FieldConfig::loadByName('block_content', $block_type_id, 'body'); $field = FieldConfig::loadByName('block_content', $block_type_id, 'body');
if (empty($field_storage)) { if (empty($field_storage)) {
$field_storage = entity_create('field_storage_config', array( $field_storage = entity_create('field_storage_config', array(
'name' => 'body', 'field_name' => 'body',
'entity_type' => 'block_content', 'entity_type' => 'block_content',
'type' => 'text_with_summary', 'type' => 'text_with_summary',
)); ));
......
...@@ -55,7 +55,7 @@ public function testBlockFields() { ...@@ -55,7 +55,7 @@ public function testBlockFields() {
// Create a field with settings to validate. // Create a field with settings to validate.
$this->fieldStorage = entity_create('field_storage_config', array( $this->fieldStorage = entity_create('field_storage_config', array(
'name' => drupal_strtolower($this->randomMachineName()), 'field_name' => drupal_strtolower($this->randomMachineName()),
'entity_type' => 'block_content', 'entity_type' => 'block_content',
'type' => 'link', 'type' => 'link',
'cardinality' => 2, 'cardinality' => 2,
......
...@@ -145,7 +145,7 @@ public function addDefaultField($entity_type, $bundle, $field_name = 'comment', ...@@ -145,7 +145,7 @@ public function addDefaultField($entity_type, $bundle, $field_name = 'comment',
// Add a default comment field for existing node comments. // Add a default comment field for existing node comments.
$field_storage = $this->entityManager->getStorage('field_storage_config')->create(array( $field_storage = $this->entityManager->getStorage('field_storage_config')->create(array(
'entity_type' => $entity_type, 'entity_type' => $entity_type,
'name' => $field_name, 'field_name' => $field_name,
'type' => 'comment', 'type' => 'comment',
'translatable' => TRUE, 'translatable' => TRUE,
'settings' => array( 'settings' => array(
...@@ -221,7 +221,7 @@ public function addBodyField($comment_type_id) { ...@@ -221,7 +221,7 @@ public function addBodyField($comment_type_id) {
$field_storage = FieldStorageConfig::loadByName('comment', 'comment_body'); $field_storage = FieldStorageConfig::loadByName('comment', 'comment_body');
if (!$field_storage) { if (!$field_storage) {
$field_storage = $this->entityManager->getStorage('field_storage_config')->create(array( $field_storage = $this->entityManager->getStorage('field_storage_config')->create(array(
'name' => 'comment_body', 'field_name' => 'comment_body',
'type' => 'text_long', 'type' => 'text_long',
'entity_type' => 'comment', 'entity_type' => 'comment',
)); ));
......
...@@ -51,7 +51,7 @@ public function testCommentFieldNonStringId() { ...@@ -51,7 +51,7 @@ public function testCommentFieldNonStringId() {
)); ));
$bundle->save(); $bundle->save();
$field_storage = entity_create('field_storage_config', array( $field_storage = entity_create('field_storage_config', array(
'name' => 'foo', 'field_name' => 'foo',
'entity_type' => 'entity_test_string_id', 'entity_type' => 'entity_test_string_id',
'settings' => array( 'settings' => array(
'comment_type' => 'entity_test_string_id', 'comment_type' => 'entity_test_string_id',
......
...@@ -48,7 +48,7 @@ public function testValidation() { ...@@ -48,7 +48,7 @@ public function testValidation() {
// Add comment field to content. // Add comment field to content.
$this->entityManager->getStorage('field_storage_config')->create(array( $this->entityManager->getStorage('field_storage_config')->create(array(
'entity_type' => 'node', 'entity_type' => 'node',
'name' => 'comment', 'field_name' => 'comment',
'type' => 'comment', 'type' => 'comment',
'settings' => array( 'settings' => array(
'comment_type' => 'comment', 'comment_type' => 'comment',
......
...@@ -46,9 +46,9 @@ function setUp() { ...@@ -46,9 +46,9 @@ function setUp() {
// Make the comment body field translatable. The title is already // Make the comment body field translatable. The title is already
// translatable by definition. // translatable by definition.
$field = FieldStorageConfig::loadByName('comment', 'comment_body'); $field_storage = FieldStorageConfig::loadByName('comment', 'comment_body');
$field->translatable = TRUE; $field_storage->translatable = TRUE;
$field->save(); $field_storage->save();
// Set up comment titles. // Set up comment titles.
$this->comment_titles = array( $this->comment_titles = array(
......
...@@ -65,7 +65,7 @@ public function testExportImport() { ...@@ -65,7 +65,7 @@ public function testExportImport() {
// Create a field. // Create a field.
$this->fieldName = drupal_strtolower($this->randomMachineName()); $this->fieldName = drupal_strtolower($this->randomMachineName());
$this->fieldStorage = entity_create('field_storage_config', array( $this->fieldStorage = entity_create('field_storage_config', array(
'name' => $this->fieldName, 'field_name' => $this->fieldName,
'entity_type' => 'node', 'entity_type' => 'node',
'type' => 'text', 'type' => 'text',
)); ));
...@@ -104,7 +104,7 @@ public function testExportImport() { ...@@ -104,7 +104,7 @@ public function testExportImport() {
} }
$field_storages = entity_load_multiple('field_storage_config'); $field_storages = entity_load_multiple('field_storage_config');
foreach ($field_storages as $field_storage) { foreach ($field_storages as $field_storage) {
if ($field_storage->name == $this->fieldName) { if ($field_storage->field_name == $this->fieldName) {
$field_storage->delete(); $field_storage->delete();
} }
} }
......
...@@ -34,7 +34,7 @@ protected function setUp() { ...@@ -34,7 +34,7 @@ protected function setUp() {
parent::setUp(); parent::setUp();
$this->field_storage = entity_create('field_storage_config', array( $this->field_storage = entity_create('field_storage_config', array(
'name' => strtolower($this->randomMachineName()), 'field_name' => strtolower($this->randomMachineName()),
'entity_type' => 'contact_message', 'entity_type' => 'contact_message',
'type' => 'text' 'type' => 'text'
)); ));
......
...@@ -80,7 +80,7 @@ protected function setUp() { ...@@ -80,7 +80,7 @@ protected function setUp() {
// Add a translatable field to the content type. // Add a translatable field to the content type.
entity_create('field_storage_config', array( entity_create('field_storage_config', array(
'name' => 'field_test_text', 'field_name' => 'field_test_text',
'entity_type' => 'node', 'entity_type' => 'node',
'type' => 'text', 'type' => 'text',
'cardinality' => 1, 'cardinality' => 1,
......
...@@ -228,7 +228,7 @@ function testFieldTranslatableSettingsUI() { ...@@ -228,7 +228,7 @@ function testFieldTranslatableSettingsUI() {
// At least one field needs to be translatable to enable article for // At least one field needs to be translatable to enable article for
// translation. Create an extra field to be used for this purpose. // translation. Create an extra field to be used for this purpose.
$field_storage = array( $field_storage = array(
'name' => 'article_text', 'field_name' => 'article_text',
'entity_type' => 'node', 'entity_type' => 'node',
'type' => 'text', 'type' => 'text',
); );
......
...@@ -50,7 +50,7 @@ protected function setupTestFields() { ...@@ -50,7 +50,7 @@ protected function setupTestFields() {
$this->cardinality = 3; $this->cardinality = 3;
entity_create('field_storage_config', array( entity_create('field_storage_config', array(
'name' => $this->fieldName, 'field_name' => $this->fieldName,
'entity_type' => $this->entityTypeId, 'entity_type' => $this->entityTypeId,
'type' => 'image', 'type' => 'image',
'cardinality' => $this->cardinality, 'cardinality' => $this->cardinality,
......
...@@ -179,7 +179,7 @@ protected function setupTestFields() { ...@@ -179,7 +179,7 @@ protected function setupTestFields() {
$this->fieldName = 'field_test_et_ui_test'; $this->fieldName = 'field_test_et_ui_test';
} }
entity_create('field_storage_config', array( entity_create('field_storage_config', array(
'name' => $this->fieldName, 'field_name' => $this->fieldName,
'type' => 'string', 'type' => 'string',
'entity_type' => $this->entityTypeId, 'entity_type' => $this->entityTypeId,
'cardinality' => 1, 'cardinality' => 1,
......
...@@ -52,8 +52,9 @@ protected function setUp() { ...@@ -52,8 +52,9 @@ protected function setUp() {
$this->drupalLogin($web_user); $this->drupalLogin($web_user);
// Create a field with settings to validate. // Create a field with settings to validate.
$field_name = drupal_strtolower($this->randomMachineName());
$this->fieldStorage = entity_create('field_storage_config', array( $this->fieldStorage = entity_create('field_storage_config', array(
'name' => drupal_strtolower($this->randomMachineName()), 'field_name' => $field_name,
'entity_type' => 'entity_test', 'entity_type' => 'entity_test',
'type' => 'datetime', 'type' => 'datetime',
'settings' => array('datetime_type' => 'date'), 'settings' => array('datetime_type' => 'date'),
...@@ -67,7 +68,7 @@ protected function setUp() { ...@@ -67,7 +68,7 @@ protected function setUp() {
$this->field->save(); $this->field->save();
entity_get_form_display($this->field->entity_type, $this->field->bundle, 'default') entity_get_form_display($this->field->entity_type, $this->field->bundle, 'default')
->setComponent($this->fieldStorage->name, array( ->setComponent($field_name, array(
'type' => 'datetime_default', 'type' => 'datetime_default',
)) ))
->save(); ->save();
...@@ -78,7 +79,7 @@ protected function setUp() { ...@@ -78,7 +79,7 @@ protected function setUp() {
'settings' => array('format_type' => 'medium'), 'settings' => array('format_type' => 'medium'),
); );
entity_get_display($this->field->entity_type, $this->field->bundle, 'full') entity_get_display($this->field->entity_type, $this->field->bundle, 'full')
->setComponent($this->fieldStorage->name, $this->display_options) ->setComponent($field_name, $this->display_options)
->save(); ->save();
} }
...@@ -86,7 +87,7 @@ protected function setUp() { ...@@ -86,7 +87,7 @@ protected function setUp() {
* Tests date field functionality. * Tests date field functionality.
*/ */
function testDateField() { function testDateField() {
$field_name = $this->fieldStorage->name; $field_name = $this->fieldStorage->field_name;
// Display creation form. // Display creation form.
$this->drupalGet('entity_test/add'); $this->drupalGet('entity_test/add');
...@@ -151,7 +152,7 @@ function testDateField() { ...@@ -151,7 +152,7 @@ function testDateField() {
* Tests date and time field. * Tests date and time field.
*/ */
function testDatetimeField() { function testDatetimeField() {
$field_name = $this->fieldStorage->name; $field_name = $this->fieldStorage->getName();
// Change the field to a datetime field. // Change the field to a datetime field.
$this->fieldStorage->settings['datetime_type'] = 'datetime'; $this->fieldStorage->settings['datetime_type'] = 'datetime';
$this->fieldStorage->save(); $this->fieldStorage->save();
...@@ -216,7 +217,7 @@ function testDatetimeField() { ...@@ -216,7 +217,7 @@ function testDatetimeField() {
* Tests Date List Widget functionality. * Tests Date List Widget functionality.
*/ */
function testDatelistWidget() { function testDatelistWidget() {
$field_name = $this->fieldStorage->name; $field_name = $this->fieldStorage->getName();
// Change the field to a datetime field. // Change the field to a datetime field.
$this->fieldStorage->settings['datetime_type'] = 'datetime'; $this->fieldStorage->settings['datetime_type'] = 'datetime';
$this->fieldStorage->save(); $this->fieldStorage->save();
...@@ -282,8 +283,9 @@ function testDefaultValue() { ...@@ -282,8 +283,9 @@ function testDefaultValue() {
$this->drupalCreateContentType(array('type' => 'date_content')); $this->drupalCreateContentType(array('type' => 'date_content'));
// Create a field storage with settings to validate. // Create a field storage with settings to validate.
$field_name = drupal_strtolower($this->randomMachineName());
$field_storage = entity_create('field_storage_config', array( $field_storage = entity_create('field_storage_config', array(
'name' => drupal_strtolower($this->randomMachineName()), 'field_name' => $field_name,
'entity_type' => 'node', 'entity_type' => 'node',
'type' => 'datetime', 'type' => 'datetime',
'settings' => array('datetime_type' => 'date'), 'settings' => array('datetime_type' => 'date'),
...@@ -300,15 +302,15 @@ function testDefaultValue() { ...@@ -300,15 +302,15 @@ function testDefaultValue() {
$field_edit = array( $field_edit = array(
'default_value_input[default_date_type]' => 'now', 'default_value_input[default_date_type]' => 'now',
); );
$this->drupalPostForm('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_storage->name, $field_edit, t('Save settings')); $this->drupalPostForm('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_name, $field_edit, t('Save settings'));
// Check that default value is selected in default value form. // Check that default value is selected in default value form.
$this->drupalGet('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_storage->name); $this->drupalGet('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_name);
$this->assertOptionSelected('edit-default-value-input-default-date-type', 'now', 'The default value is selected in instance settings page'); $this->assertOptionSelected('edit-default-value-input-default-date-type', 'now', 'The default value is selected in instance settings page');
$this->assertFieldByName('default_value_input[default_date]', '', 'The relative default value is empty in instance settings page'); $this->assertFieldByName('default_value_input[default_date]', '', 'The relative default value is empty in instance settings page');
// Check if default_date has been stored successfully. // Check if default_date has been stored successfully.
$config_entity = $this->container->get('config.factory')->get('field.field.node.date_content.' . $field_storage->name)->get(); $config_entity = $this->container->get('config.factory')->get('field.field.node.date_content.' . $field_name)->get();
$this->assertEqual($config_entity['default_value'][0], array('default_date_type' => 'now', 'default_date' => 'now'), 'Default value has been stored successfully'); $this->assertEqual($config_entity['default_value'][0], array('default_date_type' => 'now', 'default_date' => 'now'), 'Default value has been stored successfully');
// Clear field cache in order to avoid stale cache values. // Clear field cache in order to avoid stale cache values.
...@@ -317,14 +319,14 @@ function testDefaultValue() { ...@@ -317,14 +319,14 @@ function testDefaultValue() {
// Create a new node to check that datetime field default value is today. // Create a new node to check that datetime field default value is today.
$new_node = entity_create('node', array('type' => 'date_content')); $new_node = entity_create('node', array('type' => 'date_content'));
$expected_date = new DrupalDateTime('now', DATETIME_STORAGE_TIMEZONE); $expected_date = new DrupalDateTime('now', DATETIME_STORAGE_TIMEZONE);
$this->assertEqual($new_node->get($field_storage->name)->offsetGet(0)->value, $expected_date->format(DATETIME_DATE_STORAGE_FORMAT)); $this->assertEqual($new_node->get($field_name)->offsetGet(0)->value, $expected_date->format(DATETIME_DATE_STORAGE_FORMAT));
// Set an invalid relative default_value to test validation. // Set an invalid relative default_value to test validation.
$field_edit = array( $field_edit = array(
'default_value_input[default_date_type]' => 'relative', 'default_value_input[default_date_type]' => 'relative',
'default_value_input[default_date]' => 'invalid date', 'default_value_input[default_date]' => 'invalid date',
); );
$this->drupalPostForm('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_storage->name, $field_edit, t('Save settings')); $this->drupalPostForm('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_name, $field_edit, t('Save settings'));
$this->assertText('The relative date value entered is invalid.'); $this->assertText('The relative date value entered is invalid.');
...@@ -333,15 +335,15 @@ function testDefaultValue() { ...@@ -333,15 +335,15 @@ function testDefaultValue() {
'default_value_input[default_date_type]' => 'relative', 'default_value_input[default_date_type]' => 'relative',
'default_value_input[default_date]' => '+90 days', 'default_value_input[default_date]' => '+90 days',
); );
$this->drupalPostForm('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_storage->name, $field_edit, t('Save settings')); $this->drupalPostForm('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_name, $field_edit, t('Save settings'));
// Check that default value is selected in default value form. // Check that default value is selected in default value form.
$this->drupalGet('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_storage->name); $this->drupalGet('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_name);
$this->assertOptionSelected('edit-default-value-input-default-date-type', 'relative', 'The default value is selected in instance settings page'); $this->assertOptionSelected('edit-default-value-input-default-date-type', 'relative', 'The default value is selected in instance settings page');
$this->assertFieldByName('default_value_input[default_date]', '+90 days', 'The relative default value is displayed in instance settings page'); $this->assertFieldByName('default_value_input[default_date]', '+90 days', 'The relative default value is displayed in instance settings page');
// Check if default_date has been stored successfully. // Check if default_date has been stored successfully.
$config_entity = $this->container->get('config.factory')->get('field.field.node.date_content.' . $field_storage->name)->get(); $config_entity = $this->container->get('config.factory')->get('field.field.node.date_content.' . $field_name)->get();
$this->assertEqual($config_entity['default_value'][0], array('default_date_type' => 'relative', 'default_date' => '+90 days'), 'Default value has been stored successfully'); $this->assertEqual($config_entity['default_value'][0], array('default_date_type' => 'relative', 'default_date' => '+90 days'), 'Default value has been stored successfully');
// Clear field cache in order to avoid stale cache values. // Clear field cache in order to avoid stale cache values.
...@@ -350,21 +352,21 @@ function testDefaultValue() { ...@@ -350,21 +352,21 @@ function testDefaultValue() {
// Create a new node to check that datetime field default value is +90 days. // Create a new node to check that datetime field default value is +90 days.
$new_node = entity_create('node', array('type' => 'date_content')); $new_node = entity_create('node', array('type' => 'date_content'));
$expected_date = new DrupalDateTime('+90 days', DATETIME_STORAGE_TIMEZONE); $expected_date = new DrupalDateTime('+90 days', DATETIME_STORAGE_TIMEZONE);
$this->assertEqual($new_node->get($field_storage->name)->offsetGet(0)->value, $expected_date->format(DATETIME_DATE_STORAGE_FORMAT)); $this->assertEqual($new_node->get($field_name)->offsetGet(0)->value, $expected_date->format(DATETIME_DATE_STORAGE_FORMAT));
// Remove default value. // Remove default value.
$field_edit = array( $field_edit = array(
'default_value_input[default_date_type]' => '', 'default_value_input[default_date_type]' => '',
); );
$this->drupalPostForm('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_storage->name, $field_edit, t('Save settings')); $this->drupalPostForm('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_name, $field_edit, t('Save settings'));
// Check that default value is selected in default value form. // Check that default value is selected in default value form.
$this->drupalGet('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_storage->name); $this->drupalGet('admin/structure/types/manage/date_content/fields/node.date_content.' . $field_name);
$this->assertOptionSelected('edit-default-value-input-default-date-type', '', 'The default value is selected in instance settings page'); $this->assertOptionSelected('edit-default-value-input-default-date-type', '', 'The default value is selected in instance settings page');
$this->assertFieldByName('default_value_input[default_date]', '', 'The relative default value is empty in instance settings page'); $this->assertFieldByName('default_value_input[default_date]', '', 'The relative default value is empty in instance settings page');
// Check if default_date has been stored successfully. // Check if default_date has been stored successfully.
$config_entity = $this->container->get('config.factory')->get('field.field.node.date_content.' . $field_storage->name)->get(); $config_entity = $this->container->get('config.factory')->get('field.field.node.date_content.' . $field_name)->get();
$this->assertTrue(empty($config_entity['default_value']), 'Empty default value has been stored successfully'); $this->assertTrue(empty($config_entity['default_value']), 'Empty default value has been stored successfully');
// Clear field cache in order to avoid stale cache values. // Clear field cache in order to avoid stale cache values.
...@@ -372,7 +374,7 @@ function testDefaultValue() { ...@@ -372,7 +374,7 @@ function testDefaultValue() {
// Create a new node to check that datetime field default value is not set. // Create a new node to check that datetime field default value is not set.
$new_node = entity_create('node', array('type' => 'date_content')); $new_node = entity_create('node', array('type' => 'date_content'));
$this->assertNull($new_node->get($field_storage->name)->offsetGet(0)->value, 'Default value is not set'); $this->assertNull($new_node->get($field_name)->offsetGet(0)->value, 'Default value is not set');
} }
/** /**
...@@ -383,7 +385,7 @@ function testInvalidField() { ...@@ -383,7 +385,7 @@ function testInvalidField() {
// Change the field to a datetime field. // Change the field to a datetime field.
$this->fieldStorage->settings['datetime_type'] = 'datetime'; $this->fieldStorage->settings['datetime_type'] = 'datetime';
$this->fieldStorage->save(); $this->fieldStorage->save();
$field_name = $this->fieldStorage->name; $field_name = $this->fieldStorage->getName();
// Display creation form. // Display creation form.
$this->drupalGet('entity_test/add'); $this->drupalGet('entity_test/add');
......
...@@ -30,7 +30,7 @@ protected function setUp() { ...@@ -30,7 +30,7 @@ protected function setUp() {
// Create a field with settings to validate. // Create a field with settings to validate.
$field_storage = entity_create('field_storage_config', array( $field_storage = entity_create('field_storage_config', array(
'name' => 'field_datetime', 'field_name' => 'field_datetime',
'type' => 'datetime', 'type' => 'datetime',
'entity_type' => 'entity_test', 'entity_type' => 'entity_test',
'settings' => array('datetime_type' => 'date'), 'settings' => array('datetime_type' => 'date'),
......
...@@ -205,24 +205,19 @@ function entity_reference_query_entity_reference_alter(AlterableInterface $query ...@@ -205,24 +205,19 @@ function entity_reference_query_entity_reference_alter(AlterableInterface $query
*/ */
function entity_reference_create_field($entity_type, $bundle, $field_name, $field_label, $target_entity_type, $selection_handler = 'default', $selection_handler_settings = array(), $cardinality = 1) { function entity_reference_create_field($entity_type, $bundle, $field_name, $field_label, $target_entity_type, $selection_handler = 'default', $selection_handler_settings = array(), $cardinality = 1) {
// Look for or add the specified field to the requested entity bundle. // Look for or add the specified field to the requested entity bundle.
$field_storage = FieldStorageConfig::loadByName($entity_type, $field_name); if (!FieldStorageConfig::loadByName($entity_type, $field_name)) {
$field = FieldConfig::loadByName($entity_type, $bundle, $field_name); entity_create('field_storage_config', array(
'field_name' => $field_name,
if (empty($field_storage)) {
$field_storage = array(
'name' => $field_name,
'type' => 'entity_reference', 'type' => 'entity_reference',
'entity_type' => $entity_type, 'entity_type' => $entity_type,
'cardinality' => $cardinality, 'cardinality' => $cardinality,
'settings' => array( 'settings' => array(
'target_type' => $target_entity_type, 'target_type' => $target_entity_type,
), ),
); ))->save();
entity_create('field_storage_config', $field_storage)->save();
} }
if (!FieldConfig::loadByName($entity_type, $bundle, $field_name)) {
if (empty($field)) { entity_create('field_config', array(
$field = array(
'field_name' => $field_name, 'field_name' => $field_name,
'entity_type' => $entity_type, 'entity_type' => $entity_type,
'bundle' => $bundle, 'bundle' => $bundle,
...@@ -231,8 +226,7 @@ function entity_reference_create_field($entity_type, $bundle, $field_name, $fiel ...@@ -231,8 +226,7 @@ function entity_reference_create_field($entity_type, $bundle, $field_name, $fiel
'handler' => $selection_handler, 'handler' => $selection_handler,
'handler_settings' => $selection_handler_settings, 'handler_settings' => $selection_handler_settings,
), ),
); ))->save();
entity_create('field_config', $field)->save();
} }
} }
...@@ -30,7 +30,7 @@ protected function setUp() { ...@@ -30,7 +30,7 @@ protected function setUp() {
$this->referenced_type = $referenced->type; $this->referenced_type = $referenced->type;
entity_create('field_storage_config', array( entity_create('field_storage_config', array(
'name' => 'test_field', 'field_name' => 'test_field',
'entity_type' => 'node', 'entity_type' => 'node',
'translatable' => FALSE, 'translatable' => FALSE,
'entity_types' => array(), 'entity_types' => array(),
......
...@@ -42,15 +42,16 @@ function testEntityReferenceDefaultValue() { ...@@ -42,15 +42,16 @@ function testEntityReferenceDefaultValue() {