Commit 40dc8daf authored by alexpott's avatar alexpott

Issue #2095303 by swentel, plopesc, Berdir, claudiu.cristea, yched: Rename...

Issue #2095303 by swentel, plopesc, Berdir, claudiu.cristea, yched: Rename 'field_entity' to 'field_config' and 'field_instance' to 'field_instance_config'.
parent b65c8f41
......@@ -18,7 +18,7 @@
use Drupal\field\FieldUpdateForbiddenException;
use Drupal\field\FieldInterface;
use Drupal\field\FieldInstanceInterface;
use Drupal\field\Entity\Field;
use Drupal\field\Entity\FieldConfig;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
......
......@@ -17,7 +17,7 @@
use Drupal\field\FieldUpdateForbiddenException;
use Drupal\field\FieldInterface;
use Drupal\field\FieldInstanceInterface;
use Drupal\field\Entity\Field;
use Drupal\field\Entity\FieldConfig;
use Symfony\Component\DependencyInjection\ContainerInterface;
/**
......@@ -1099,7 +1099,7 @@ public function onBundleRename($bundle, $bundle_new) {
// We need to account for deleted fields and instances. The method runs
// before the instance definitions are updated, so we need to fetch them
// using the old bundle name.
$instances = entity_load_multiple_by_properties('field_instance', array('entity_type' => $this->entityTypeId, 'bundle' => $bundle, 'include_deleted' => TRUE));
$instances = entity_load_multiple_by_properties('field_instance_config', array('entity_type' => $this->entityTypeId, 'bundle' => $bundle, 'include_deleted' => TRUE));
foreach ($instances as $instance) {
$field = $instance->getField();
$table_name = static::_fieldTableName($field);
......@@ -1451,7 +1451,7 @@ static public function _fieldIndexName(FieldInterface $field, $index) {
* unique among all other fields.
*/
static public function _fieldColumnName(FieldInterface $field, $column) {
return in_array($column, Field::getReservedColumns()) ? $column : $field->getName() . '_' . $column;
return in_array($column, FieldConfig::getReservedColumns()) ? $column : $field->getName() . '_' . $column;
}
}
......@@ -12,7 +12,7 @@
use Drupal\Core\Entity\FieldableDatabaseStorageController;
use Drupal\Core\Entity\Plugin\DataType\EntityReference;
use Drupal\Core\Entity\Query\QueryException;
use Drupal\field\Entity\Field;
use Drupal\field\Entity\FieldConfig;
use Drupal\field\Field as FieldInfo;
/**
......@@ -118,7 +118,7 @@ public function addField($field, $type, $langcode) {
$next = $specifiers[$key + 1];
// Is this a field column?
$columns = $field->getColumns();
if (isset($columns[$next]) || in_array($next, Field::getReservedColumns())) {
if (isset($columns[$next]) || in_array($next, FieldConfig::getReservedColumns())) {
// Use it.
$column = $next;
// Do not process it again.
......
......@@ -27,18 +27,19 @@
* It is up to the class implementing this interface to manage where the
* information comes from. For example, field.module provides an implementation
* based on two levels of configuration. It allows the site administrator to add
* custom fields to any entity type and bundle via the "field_entity" and
* "field_instance" configuration entities. The former for storing configuration
* that is independent of which entity type and bundle the field is added to,
* and the latter for storing configuration that is specific to the entity type
* and bundle. The class that implements "field_instance" configuration entities
* also implements this interface, returning information from either itself, or
* from the corresponding "field_entity" configuration, as appropriate.
* custom fields to any entity type and bundle via the "field_config" and
* "field_instance_config" configuration entities. The former for storing
* configuration that is independent of which entity type and bundle the field
* is added to, and the latter for storing configuration that is specific to the
* entity type and bundle. The class that implements "field_instance_config"
* configuration entities also implements this interface, returning information
* from either itself, or from the corresponding "field_config" configuration,
* as appropriate.
*
* However, entity base fields, such as $node->title, are not managed by
* field.module and its "field_entity"/"field_instance" configuration entities.
* Therefore, their definitions are provided by different objects based on the
* class \Drupal\Core\Field\FieldDefinition, which implements this
* field.module and its "field_config"/"field_instance_config" configuration
* entities. Therefore, their definitions are provided by different objects
* based on the class \Drupal\Core\Field\FieldDefinition, which implements this
* interface as well.
*
* Field definitions may fully define a concrete data object (e.g.,
......
......@@ -176,7 +176,7 @@ function custom_block_add_body_field($block_type_id, $label = 'Block body') {
$field = field_info_field('custom_block', 'body');
$instance = field_info_instance('custom_block', 'body', $block_type_id);
if (empty($field)) {
$field = entity_create('field_entity', array(
$field = entity_create('field_config', array(
'name' => 'body',
'entity_type' => 'custom_block',
'type' => 'text_with_summary',
......@@ -184,7 +184,7 @@ function custom_block_add_body_field($block_type_id, $label = 'Block body') {
$field->save();
}
if (empty($instance)) {
$instance = entity_create('field_instance', array(
$instance = entity_create('field_instance_config', array(
'field_name' => 'body',
'entity_type' => 'custom_block',
'bundle' => $block_type_id,
......
......@@ -25,14 +25,14 @@ class CustomBlockFieldTest extends CustomBlockTestBase {
/**
* The created field.
*
* @var \Drupal\field\Entity\Field
* @var \Drupal\field\Entity\FieldConfig
*/
protected $field;
/**
* The created instance.
*
* @var \Drupal\field\Entity\FieldInstance
* @var \Drupal\field\Entity\FieldInstanceConfig
*/
protected $instance;
......@@ -64,14 +64,14 @@ public function testBlockFields() {
$this->blockType = $this->createCustomBlockType('link');
// Create a field with settings to validate.
$this->field = entity_create('field_entity', array(
$this->field = entity_create('field_config', array(
'name' => drupal_strtolower($this->randomName()),
'entity_type' => 'custom_block',
'type' => 'link',
'cardinality' => 2,
));
$this->field->save();
$this->instance = entity_create('field_instance', array(
$this->instance = entity_create('field_instance_config', array(
'field_name' => $this->field->getName(),
'entity_type' => 'custom_block',
'bundle' => 'link',
......
......@@ -5,16 +5,12 @@
* Install, update and uninstall functions for the Comment module.
*/
use Drupal\Core\Language\Language;
use Drupal\comment\Plugin\Field\FieldType\CommentItem;
use Drupal\field\Entity\Field;
/**
* Implements hook_uninstall().
*/
function comment_uninstall() {
// Remove the comment fields.
$fields = entity_load_multiple_by_properties('field_entity', array('type' => 'comment'));
$fields = entity_load_multiple_by_properties('field_config', array('type' => 'comment'));
foreach ($fields as $field) {
entity_invoke_bundle_hook('delete', 'comment', $field->entity_type . '__' . $field->name);
$field->delete();
......
......@@ -236,9 +236,9 @@ function comment_count_unpublished() {
}
/**
* Implements hook_ENTITY_TYPE_insert() for 'field_instance'.
* Implements hook_ENTITY_TYPE_insert() for 'field_instance_config'.
*/
function comment_field_instance_insert(FieldInstanceInterface $instance) {
function comment_field_instance_config_insert(FieldInstanceInterface $instance) {
if ($instance->getType() == 'comment' && !$instance->isSyncing()) {
\Drupal::service('comment.manager')->addBodyField($instance->entity_type, $instance->getName());
\Drupal::cache()->delete('comment_entity_info');
......@@ -246,9 +246,9 @@ function comment_field_instance_insert(FieldInstanceInterface $instance) {
}
/**
* Implements hook_ENTITY_TYPE_create() for 'field_instance'.
* Implements hook_ENTITY_TYPE_create() for 'field_instance_config'.
*/
function comment_field_instance_create(FieldInstanceInterface $instance) {
function comment_field_instance_config_create(FieldInstanceInterface $instance) {
if ($instance->getType() == 'comment' && !$instance->isSyncing()) {
// Assign default values for the field instance.
if (!isset($instance->default_value)) {
......@@ -267,9 +267,9 @@ function comment_field_instance_create(FieldInstanceInterface $instance) {
}
/**
* Implements hook_ENTITY_TYPE_update() for 'field_instance'.
* Implements hook_ENTITY_TYPE_update() for 'field_instance_config'.
*/
function comment_field_instance_update(FieldInstanceInterface $instance) {
function comment_field_instance_config_update(FieldInstanceInterface $instance) {
if ($instance->getType() == 'comment') {
\Drupal::entityManager()->getViewBuilder($instance->entity_type)->resetCache();
// Comment field settings also affects the rendering of *comment* entities,
......@@ -279,9 +279,9 @@ function comment_field_instance_update(FieldInstanceInterface $instance) {
}
/**
* Implements hook_ENTITY_TYPE_delete() for 'field_entity'.
* Implements hook_ENTITY_TYPE_delete() for 'field_config'.
*/
function comment_field_entity_delete(FieldInterface $field) {
function comment_field_config_delete(FieldInterface $field) {
if ($field->getType() == 'comment') {
// Delete all fields and displays attached to the comment bundle.
entity_invoke_bundle_hook('delete', 'comment', $field->getName());
......@@ -290,9 +290,9 @@ function comment_field_entity_delete(FieldInterface $field) {
}
/**
* Implements hook_ENTITY_TYPE_delete() for 'field_instance'.
* Implements hook_ENTITY_TYPE_delete() for 'field_instance_config'.
*/
function comment_field_instance_delete(FieldInstanceInterface $instance) {
function comment_field_instance_config_delete(FieldInstanceInterface $instance) {
if ($instance->getType() == 'comment') {
// Delete all comments that used by the entity bundle.
$comments = db_query("SELECT cid FROM {comment} WHERE entity_type = :entity_type AND field_id = :field_id", array(
......
......@@ -142,7 +142,7 @@ public function addDefaultField($entity_type, $bundle, $field_name = 'comment',
// Make sure the field doesn't already exist.
if (!$this->fieldInfo->getField($entity_type, $field_name)) {
// Add a default comment field for existing node comments.
$field = $this->entityManager->getStorageController('field_entity')->create(array(
$field = $this->entityManager->getStorageController('field_config')->create(array(
'entity_type' => $entity_type,
'name' => $field_name,
'type' => 'comment',
......@@ -153,7 +153,7 @@ public function addDefaultField($entity_type, $bundle, $field_name = 'comment',
}
// Make sure the instance doesn't already exist.
if (!$this->fieldInfo->getInstance($entity_type, $bundle, $field_name)) {
$instance = $this->entityManager->getStorageController('field_instance')->create(array(
$instance = $this->entityManager->getStorageController('field_instance_config')->create(array(
'label' => 'Comment settings',
'description' => '',
'field_name' => $field_name,
......@@ -197,9 +197,9 @@ public function addDefaultField($entity_type, $bundle, $field_name = 'comment',
*/
public function addBodyField($entity_type, $field_name) {
// Create the field if needed.
$field = $this->entityManager->getStorageController('field_entity')->load('comment.comment_body');
$field = $this->entityManager->getStorageController('field_config')->load('comment.comment_body');
if (!$field) {
$field = $this->entityManager->getStorageController('field_entity')->create(array(
$field = $this->entityManager->getStorageController('field_config')->create(array(
'name' => 'comment_body',
'type' => 'text_long',
'entity_type' => 'comment',
......@@ -209,11 +209,11 @@ public function addBodyField($entity_type, $field_name) {
// Create the instance if needed, field name defaults to 'comment'.
$comment_bundle = $entity_type . '__' . $field_name;
$field_instance = $this->entityManager
->getStorageController('field_instance')
->getStorageController('field_instance_config')
->load("comment.$comment_bundle.comment_body");
if (!$field_instance) {
// Attaches the body field by default.
$field_instance = $this->entityManager->getStorageController('field_instance')->create(array(
$field_instance = $this->entityManager->getStorageController('field_instance_config')->create(array(
'field_name' => 'comment_body',
'label' => 'Comment',
'entity_type' => 'comment',
......
......@@ -60,7 +60,7 @@ function testCommentDefaultFields() {
// Test adding a field that defaults to COMMENT_CLOSED.
$this->container->get('comment.manager')->addDefaultField('node', 'test_node_type', 'who_likes_ponies', COMMENT_CLOSED);
$field = entity_load('field_instance', 'node.test_node_type.who_likes_ponies');
$field = entity_load('field_instance_config', 'node.test_node_type.who_likes_ponies');
$this->assertEqual($field->default_value[0]['status'], COMMENT_CLOSED);
}
......@@ -73,7 +73,7 @@ function testCommentInstallAfterContentModule() {
$this->drupalLogin($this->admin_user);
// Drop default comment field added in CommentTestBase::setup().
entity_load('field_entity', 'node.comment')->delete();
entity_load('field_config', 'node.comment')->delete();
if ($field = $this->container->get('field.info')->getField('node', 'comment_node_forum')) {
$field->delete();
}
......
......@@ -31,11 +31,11 @@ function testNodeDeletion() {
$this->assertFalse(comment_load($comment->id()), 'The comment could not be loaded after the node was deleted.');
// Make sure the comment field and all its instances are deleted when node
// type is deleted.
$this->assertNotNull(entity_load('field_entity', 'node.comment'), 'Comment field exists');
$this->assertNotNull(entity_load('field_instance', 'node.article.comment'), 'Comment instance exists');
$this->assertNotNull(entity_load('field_config', 'node.comment'), 'Comment field exists');
$this->assertNotNull(entity_load('field_instance_config', 'node.article.comment'), 'Comment instance exists');
// Delete the node type.
entity_delete_multiple('node_type', array($this->node->bundle()));
$this->assertNull(entity_load('field_entity', 'node.comment'), 'Comment field deleted');
$this->assertNull(entity_load('field_instance', 'node.article.comment'), 'Comment instance deleted');
$this->assertNull(entity_load('field_config', 'node.comment'), 'Comment field deleted');
$this->assertNull(entity_load('field_instance_config', 'node.article.comment'), 'Comment instance deleted');
}
}
......@@ -46,13 +46,13 @@ public function setUp() {
*/
public function testValidation() {
// Add comment field to content.
$this->entityManager->getStorageController('field_entity')->create(array(
$this->entityManager->getStorageController('field_config')->create(array(
'entity_type' => 'node',
'name' => 'comment',
'type' => 'comment',
))->save();
// Add comment field instance to page content.
$this->entityManager->getStorageController('field_instance')->create(array(
$this->entityManager->getStorageController('field_instance_config')->create(array(
'field_name' => 'comment',
'entity_type' => 'node',
'bundle' => 'page',
......
......@@ -52,7 +52,7 @@ function hook_config_translation_info(&$info) {
if ($entity_type->isFieldable() && !empty($base_route)) {
$info[$entity_type_id . '_fields'] = array(
'base_route_name' => 'field_ui.instance_edit_' . $entity_type_id,
'entity_type' => 'field_instance',
'entity_type' => 'field_instance_config',
'title' => t('!label field'),
'class' => '\Drupal\config_translation\ConfigFieldInstanceMapper',
'base_entity_type' => $entity_type_id,
......
......@@ -94,9 +94,9 @@ function config_translation_entity_info_alter($entity_info) {
if ($entity_type_id == 'block') {
$class = 'Drupal\config_translation\Controller\ConfigTranslationBlockListController';
}
elseif ($entity_type_id == 'field_instance') {
elseif ($entity_type_id == 'field_instance_config') {
$class = 'Drupal\config_translation\Controller\ConfigTranslationFieldInstanceListController';
// Will be filled in dynamically, see \Drupal\field\Entity\FieldInstance::linkTemplates().
// Will be filled in dynamically, see \Drupal\field\Entity\FieldInstanceConfig::linkTemplates().
$entity_type->setLinkTemplate('drupal:config-translation-overview', 'config_translation.item.overview.');
}
else {
......@@ -135,7 +135,7 @@ function config_translation_config_translation_info(&$info) {
if ($entity_type->isFieldable() && !empty($base_route)) {
$info[$entity_type_id . '_fields'] = array(
'base_route_name' => 'field_ui.instance_edit_' . $entity_type_id,
'entity_type' => 'field_instance',
'entity_type' => 'field_instance_config',
'title' => '!label field',
'class' => '\Drupal\config_translation\ConfigFieldInstanceMapper',
'base_entity_type' => $entity_type_id,
......
......@@ -25,7 +25,7 @@ class ContactFieldsTest extends ViewTestBase {
/**
* Contains the field definition array attached to contact used for this test.
*
* @var \Drupal\field\Entity\Field
* @var \Drupal\field\Entity\FieldConfig
*/
protected $field;
......@@ -40,14 +40,14 @@ public static function getInfo() {
protected function setUp() {
parent::setUp();
$this->field = entity_create('field_entity', array(
$this->field = entity_create('field_config', array(
'name' => strtolower($this->randomName()),
'entity_type' => 'contact_message',
'type' => 'text'
));
$this->field->save();
entity_create('field_instance', array(
entity_create('field_instance_config', array(
'field_name' => $this->field->name,
'entity_type' => 'contact_message',
'bundle' => 'contact_message',
......
......@@ -188,13 +188,13 @@ function testFieldTranslatableSettingsUI() {
'entity_type' => 'node',
'type' => 'text',
);
entity_create('field_entity', $field)->save();
entity_create('field_config', $field)->save();
$instance = array(
'field_name' => 'article_text',
'entity_type' => 'node',
'bundle' => 'article',
);
entity_create('field_instance', $instance)->save();
entity_create('field_instance_config', $instance)->save();
// Tests that field instance doesn't have translatable setting if bundle
// is not translatable.
......
......@@ -56,7 +56,7 @@ protected function setupTestFields() {
$this->fieldName = 'field_test_et_ui_image';
$this->cardinality = 3;
entity_create('field_entity', array(
entity_create('field_config', array(
'name' => $this->fieldName,
'entity_type' => $this->entityTypeId,
'type' => 'image',
......@@ -64,7 +64,7 @@ protected function setupTestFields() {
'translatable' => TRUE,
))->save();
entity_create('field_instance', array(
entity_create('field_instance_config', array(
'entity_type' => $this->entityTypeId,
'field_name' => $this->fieldName,
'bundle' => $this->entityTypeId,
......
......@@ -175,14 +175,14 @@ protected function enableTranslation() {
protected function setupTestFields() {
$this->fieldName = 'field_test_et_ui_test';
entity_create('field_entity', array(
entity_create('field_config', array(
'name' => $this->fieldName,
'type' => 'text',
'entity_type' => $this->entityTypeId,
'cardinality' => 1,
'translatable' => TRUE,
))->save();
entity_create('field_instance', array(
entity_create('field_instance_config', array(
'entity_type' => $this->entityTypeId,
'field_name' => $this->fieldName,
'bundle' => $this->bundle,
......
......@@ -26,14 +26,14 @@ class DateTimeFieldTest extends WebTestBase {
/**
* A field to use in this test class.
*
* @var \Drupal\field\Entity\Field
* @var \Drupal\field\Entity\FieldConfig
*/
protected $field;
/**
* The instance used in this test class.
*
* @var \Drupal\field\Entity\FieldInstance
* @var \Drupal\field\Entity\FieldInstanceConfig
*/
protected $instance;
......@@ -58,14 +58,14 @@ function setUp() {
$this->drupalLogin($web_user);
// Create a field with settings to validate.
$this->field = entity_create('field_entity', array(
$this->field = entity_create('field_config', array(
'name' => drupal_strtolower($this->randomName()),
'entity_type' => 'entity_test',
'type' => 'datetime',
'settings' => array('datetime_type' => 'date'),
));
$this->field->save();
$this->instance = entity_create('field_instance', array(
$this->instance = entity_create('field_instance_config', array(
'field_name' => $this->field->name,
'entity_type' => 'entity_test',
'bundle' => 'entity_test',
......@@ -296,7 +296,7 @@ function testDefaultValue() {
$this->drupalCreateContentType(array('type' => 'date_content'));
// Create a field with settings to validate.
$field = entity_create('field_entity', array(
$field = entity_create('field_config', array(
'name' => drupal_strtolower($this->randomName()),
'entity_type' => 'node',
'type' => 'datetime',
......@@ -304,7 +304,7 @@ function testDefaultValue() {
));
$field->save();
$instance = entity_create('field_instance', array(
$instance = entity_create('field_instance_config', array(
'field_name' => $field->name,
'entity_type' => 'node',
'bundle' => 'date_content',
......
......@@ -35,14 +35,14 @@ public function setUp() {
parent::setUp();
// Create a field with settings to validate.
$this->field = entity_create('field_entity', array(
$this->field = entity_create('field_config', array(
'name' => 'field_datetime',
'type' => 'datetime',
'entity_type' => 'entity_test',
'settings' => array('datetime_type' => 'date'),
));
$this->field->save();
$this->instance = entity_create('field_instance', array(
$this->instance = entity_create('field_instance_config', array(
'field_name' => $this->field->getName(),
'entity_type' => 'entity_test',
'bundle' => 'entity_test',
......
......@@ -79,7 +79,7 @@ protected function setUp() {
));
$this->vocabulary->save();
$this->field_name = 'field_' . $this->vocabulary->id();
entity_create('field_entity', array(
entity_create('field_config', array(
'name' => $this->field_name,
'entity_type' => 'node',
'type' => 'taxonomy_term_reference',
......@@ -94,7 +94,7 @@ protected function setUp() {
),
),
))->save();
$instance = entity_create('field_instance', array(
$instance = entity_create('field_instance_config', array(
'field_name' => $this->field_name,
'entity_type' => 'node',
'label' => 'Tags',
......
......@@ -54,7 +54,7 @@ protected function setUp() {
*/
public function createFieldWithInstance($field_name, $type, $cardinality, $label, $instance_settings, $widget_type, $widget_settings, $formatter_type, $formatter_settings) {
$field = $field_name . '_field';
$this->$field = entity_create('field_entity', array(
$this->$field = entity_create('field_config', array(
'name' => $field_name,
'entity_type' => 'entity_test',
'type' => $type,
......@@ -63,7 +63,7 @@ public function createFieldWithInstance($field_name, $type, $cardinality, $label
$this->$field->save();
$instance = $field_name . '_instance';
$this->$instance = entity_create('field_instance', array(
$this->$instance = entity_create('field_instance_config', array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'bundle' => 'entity_test',
......
......@@ -83,13 +83,13 @@ public function providerTestAccess() {
->method('access')
->will($this->returnValue(FALSE));
$field_with_access = $this->getMockBuilder('Drupal\field\Entity\Field')
$field_with_access = $this->getMockBuilder('Drupal\field\Entity\FieldConfig')
->disableOriginalConstructor()
->getMock();
$field_with_access->expects($this->any())
->method('access')
->will($this->returnValue(TRUE));
$field_without_access = $this->getMockBuilder('Drupal\field\Entity\Field')
$field_without_access = $this->getMockBuilder('Drupal\field\Entity\FieldConfig')
->disableOriginalConstructor()
->getMock();
$field_without_access->expects($this->any())
......
......@@ -25,14 +25,14 @@ class EmailFieldTest extends WebTestBase {
/**
* A field to use in this test class.
*
* @var \Drupal\field\Entity\Field
* @var \Drupal\field\Entity\FieldConfig
*/
protected $field;
/**
* The instance used in this test class.
*
* @var \Drupal\field\Entity\FieldInstance
* @var \Drupal\field\Entity\FieldInstanceConfig
*/
protected $instance;
......@@ -61,13 +61,13 @@ function setUp() {
function testEmailField() {
// Create a field with settings to validate.
$field_name = drupal_strtolower($this->randomName());
$this->field = entity_create('field_entity', array(
$this->field = entity_create('field_config', array(
'name' => $field_name,
'entity_type' => 'entity_test',
'type' => 'email',
));
$this->field->save();
$this->instance = entity_create('field_instance', array(
$this->instance = entity_create('field_instance_config', array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'bundle' => 'entity_test',
......
......@@ -35,12 +35,12 @@ public function setUp() {
parent::setUp();
// Create an email field and instance for validation.
entity_create('field_entity', array(
entity_create('field_config', array(
'name' => 'field_email',
'entity_type' => 'entity_test',
'type' => 'email',
))->save();
entity_create('field_instance', array(
entity_create('field_instance_config', array(
'entity_type' => 'entity_test',
'field_name' => 'field_email',
'bundle' => 'entity_test',
......
......@@ -136,13 +136,13 @@ public function testFieldComponent() {
$field_name = 'test_field';
// Create a field and an instance.
$field = entity_create('field_entity', array(
$field = entity_create('field_config', array(
'name' => $field_name,
'entity_type' => 'entity_test',
'type' => 'test_field'
));
$field->save();
$instance = entity_create('field_instance', array(
$instance = entity_create('field_instance_config', array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'bundle' => 'entity_test',
......@@ -303,13 +303,13 @@ public function testDeleteFieldInstance() {
$field_name = 'test_field';
// Create a field and an instance.
$field = entity_create('field_entity', array(
$field = entity_create('field_config', array(
'name' => $field_name,
'entity_type' => 'entity_test',
'type' => 'test_field'
));
$field->save();
$instance = entity_create('field_instance', array(
$instance = entity_create('field_instance_config', array(
'field_name' => $field_name,
'entity_type' => 'entity_test',
'bundle' => 'entity_test',
......
......@@ -57,13 +57,13 @@ public function testFieldComponent() {
// Create a field and an instance.
$field_name = 'test_field';
$field = entity_create('field_entity', array(
$field = entity_create('field_config', array(
'name' => $field_name,
'entity_type' => 'entity_test',
'type' => 'test_field'