diff --git a/core/includes/entity.inc b/core/includes/entity.inc
index 708706e..32f5002 100644
--- a/core/includes/entity.inc
+++ b/core/includes/entity.inc
@@ -43,6 +43,7 @@ function entity_info_cache_clear() {
   drupal_static_reset('entity_get_bundles');
   // Clear all languages.
   drupal_container()->get('plugin.manager.entity')->clearCachedDefinitions();
+  drupal_container()->get('plugin.manager.entity')->resetControllers();
 }
 
 /**
diff --git a/core/lib/Drupal/Core/Entity/EntityManager.php b/core/lib/Drupal/Core/Entity/EntityManager.php
index a0d7c03..bb614b0 100644
--- a/core/lib/Drupal/Core/Entity/EntityManager.php
+++ b/core/lib/Drupal/Core/Entity/EntityManager.php
@@ -327,4 +327,11 @@ public function getAccessController($entity_type) {
     return $this->controllers['access'][$entity_type];
   }
 
+  /**
+   * @todo: Directly allow to clear the cache in the storage controller.
+   */
+  public function resetControllers() {
+    $this->controllers = array();
+  }
+
 }
diff --git a/core/lib/Drupal/Core/TypedData/Type/Date.php b/core/lib/Drupal/Core/TypedData/Type/Date.php
index e326674..3d72f24 100644
--- a/core/lib/Drupal/Core/TypedData/Type/Date.php
+++ b/core/lib/Drupal/Core/TypedData/Type/Date.php
@@ -24,7 +24,7 @@ class Date extends TypedData {
   /**
    * The data value.
    *
-   * @var DateTime
+   * @var \Drupal\Core\Datetime\DrupalDateTime
    */
   protected $value;
 
diff --git a/core/modules/datetime/lib/Drupal/datetime/Tests/DateTimeFieldTest.php b/core/modules/datetime/lib/Drupal/datetime/Tests/DateTimeFieldTest.php
deleted file mode 100644
index 232d019..0000000
--- a/core/modules/datetime/lib/Drupal/datetime/Tests/DateTimeFieldTest.php
+++ /dev/null
@@ -1,428 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\datetime\Tests\DatetimeFieldTest.
- */
-
-namespace Drupal\datetime\Tests;
-
-use Drupal\simpletest\WebTestBase;
-use Drupal\Core\Datetime\DrupalDateTime;
-
-/**
- * Tests Datetime field functionality.
- */
-class DatetimeFieldTest extends WebTestBase {
-
-  /**
-   * Modules to enable.
-   *
-   * @var array
-   */
-  public static $modules = array('node', 'field_test', 'datetime', 'field_ui');
-
-  /**
-   * A field to use in this test class.
-   *
-   * @var \Drupal\Core\Datetime\DrupalDateTime
-   */
-  protected $field;
-
-  public static function getInfo() {
-    return array(
-      'name'  => 'Datetime Field',
-      'description'  => 'Tests datetime field functionality.',
-      'group' => 'Datetime',
-    );
-  }
-
-  function setUp() {
-    parent::setUp();
-
-    $web_user = $this->drupalCreateUser(array(
-      'access field_test content',
-      'administer field_test content',
-      'administer content types',
-    ));
-    $this->drupalLogin($web_user);
-
-    // Create a field with settings to validate.
-    $this->field = array(
-      'field_name' => drupal_strtolower($this->randomName()),
-      'type' => 'datetime',
-      'settings' => array('datetime_type' => 'date'),
-    );
-    field_create_field($this->field);
-    $this->instance = array(
-      'field_name' => $this->field['field_name'],
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
-      'widget' => array(
-        'type' => 'datetime_default',
-      ),
-      'settings' => array(
-        'default_value' => 'blank',
-      ),
-    );
-    field_create_instance($this->instance);
-
-    $this->display_options = array(
-      'type' => 'datetime_default',
-      'label' => 'hidden',
-      'settings' => array('format_type' => 'medium'),
-    );
-    entity_get_display($this->instance['entity_type'], $this->instance['bundle'], 'full')
-      ->setComponent($this->field['field_name'], $this->display_options)
-      ->save();
-  }
-
-  /**
-   * Tests date field functionality.
-   */
-  function testDateField() {
-
-    // Display creation form.
-    $this->drupalGet('test-entity/add/test_bundle');
-    $langcode = LANGUAGE_NOT_SPECIFIED;
-    $this->assertFieldByName("{$this->field['field_name']}[$langcode][0][value][date]", '', 'Date element found.');
-    $this->assertNoFieldByName("{$this->field['field_name']}[$langcode][0][value][time]", '', 'Time element not found.');
-
-    // Submit a valid date and ensure it is accepted.
-    $value = '2012-12-31 00:00:00';
-    $date = new DrupalDateTime($value);
-    $format_type = $date->canUseIntl() ? DrupalDateTime::INTL : DrupalDateTime::PHP;
-    $date_format = config('system.date')->get('formats.html_date.pattern.' . $format_type);
-    $time_format = config('system.date')->get('formats.html_time.pattern.' . $format_type);
-
-    $edit = array(
-      "{$this->field['field_name']}[$langcode][0][value][date]" => $date->format($date_format),
-    );
-    $this->drupalPost(NULL, $edit, t('Save'));
-    preg_match('|test-entity/manage/(\d+)/edit|', $this->url, $match);
-    $id = $match[1];
-    $this->assertRaw(t('test_entity @id has been created.', array('@id' => $id)));
-    $this->assertRaw($date->format($date_format));
-    $this->assertNoRaw($date->format($time_format));
-
-    // The expected values will use the default time.
-    datetime_date_default_time($date);
-
-    // Verify that the date is output according to the formatter settings.
-    $options = array(
-      'format_type' => array('short', 'medium', 'long'),
-    );
-    foreach ($options as $setting => $values) {
-      foreach ($values as $new_value) {
-        // Update the entity display settings.
-        $this->display_options['settings'] = array($setting => $new_value);
-        $display = entity_get_display($this->instance['entity_type'], $this->instance['bundle'], 'full')
-          ->setComponent($this->instance['field_name'], $this->display_options)
-          ->save();
-
-        $this->renderTestEntity($id);
-        switch ($setting) {
-          case 'format_type':
-            // Verify that a date is displayed.
-            $expected = format_date($date->getTimestamp(), $new_value);
-            $this->renderTestEntity($id);
-            $this->assertText($expected, format_string('Formatted date field using %value format displayed as %expected.', array('%value' => $new_value, '%expected' => $expected)));
-            break;
-        }
-      }
-    }
-
-    // Verify that the plain formatter works.
-    $this->display_options['type'] = 'datetime_plain';
-    $display = entity_get_display($this->instance['entity_type'], $this->instance['bundle'], 'full')
-      ->setComponent($this->instance['field_name'], $this->display_options)
-      ->save();
-    $expected = $date->format(DATETIME_DATE_STORAGE_FORMAT);
-    $this->renderTestEntity($id);
-    $this->assertText($expected, format_string('Formatted date field using plain format displayed as %expected.', array('%expected' => $expected)));
-  }
-
-  /**
-   * Tests date and time field.
-   */
-  function testDatetimeField() {
-
-    // Change the field to a datetime field.
-    $this->field['settings']['datetime_type'] = 'datetime';
-    field_update_field($this->field);
-
-    // Display creation form.
-    $this->drupalGet('test-entity/add/test_bundle');
-    $langcode = LANGUAGE_NOT_SPECIFIED;
-    $this->assertFieldByName("{$this->field['field_name']}[$langcode][0][value][date]", '', 'Date element found.');
-    $this->assertFieldByName("{$this->field['field_name']}[$langcode][0][value][time]", '', 'Time element found.');
-
-    // Submit a valid date and ensure it is accepted.
-    $value = '2012-12-31 00:00:00';
-    $date = new DrupalDateTime($value);
-    $format_type = $date->canUseIntl() ? DrupalDateTime::INTL : DrupalDateTime::PHP;
-    $date_format = config('system.date')->get('formats.html_date.pattern.' . $format_type);
-    $time_format = config('system.date')->get('formats.html_time.pattern.' . $format_type);
-
-    $edit = array(
-      "{$this->field['field_name']}[$langcode][0][value][date]" => $date->format($date_format),
-      "{$this->field['field_name']}[$langcode][0][value][time]" => $date->format($time_format),
-    );
-    $this->drupalPost(NULL, $edit, t('Save'));
-    preg_match('|test-entity/manage/(\d+)/edit|', $this->url, $match);
-    $id = $match[1];
-    $this->assertRaw(t('test_entity @id has been created.', array('@id' => $id)));
-    $this->assertRaw($date->format($date_format));
-    $this->assertRaw($date->format($time_format));
-
-    // Verify that the date is output according to the formatter settings.
-    $options = array(
-      'format_type' => array('short', 'medium', 'long'),
-    );
-    foreach ($options as $setting => $values) {
-      foreach ($values as $new_value) {
-        // Update the entity display settings.
-        $this->display_options['settings'] = array($setting => $new_value);
-        $display = entity_get_display($this->instance['entity_type'], $this->instance['bundle'], 'full')
-          ->setComponent($this->instance['field_name'], $this->display_options)
-          ->save();
-
-        $this->renderTestEntity($id);
-        switch ($setting) {
-          case 'format_type':
-            // Verify that a date is displayed.
-            $expected = format_date($date->getTimestamp(), $new_value);
-            $this->renderTestEntity($id);
-            $this->assertText($expected, format_string('Formatted date field using %value format displayed as %expected.', array('%value' => $new_value, '%expected' => $expected)));
-            break;
-        }
-      }
-    }
-
-    // Verify that the plain formatter works.
-    $this->display_options['type'] = 'datetime_plain';
-    $display = entity_get_display($this->instance['entity_type'], $this->instance['bundle'], 'full')
-      ->setComponent($this->instance['field_name'], $this->display_options)
-      ->save();
-    $expected = $date->format(DATETIME_DATETIME_STORAGE_FORMAT);
-    $this->renderTestEntity($id);
-    $this->assertText($expected, format_string('Formatted date field using plain format displayed as %expected.', array('%expected' => $expected)));
-  }
-
-  /**
-   * Tests Date List Widget functionality.
-   */
-  function testDatelistWidget() {
-
-    // Change the field to a datetime field.
-    $this->field['settings']['datetime_type'] = 'datetime';
-    field_update_field($this->field);
-
-    // Change the widget to a datelist widget.
-    $increment = 1;
-    $date_order = 'YMD';
-    $time_type = '12';
-
-    $this->instance['widget']['type'] = 'datetime_datelist';
-    $this->instance['widget']['settings'] = array(
-      'increment' => $increment,
-      'date_order' => $date_order,
-      'time_type' => $time_type,
-    );
-    field_update_instance($this->instance);
-    field_cache_clear();
-
-    // Display creation form.
-    $this->drupalGet('test-entity/add/test_bundle');
-    $field_name = $this->field['field_name'];
-    $langcode = LANGUAGE_NOT_SPECIFIED;
-
-    $this->assertFieldByXPath("//*[@id=\"edit-$field_name-$langcode-0-value-year\"]", NULL, 'Year element found.');
-    $this->assertOptionSelected("edit-$field_name-$langcode-0-value-year", '', 'No year selected.');
-    $this->assertFieldByXPath("//*[@id=\"edit-$field_name-$langcode-0-value-month\"]", NULL, 'Month element found.');
-    $this->assertOptionSelected("edit-$field_name-$langcode-0-value-month", '', 'No month selected.');
-    $this->assertFieldByXPath("//*[@id=\"edit-$field_name-$langcode-0-value-day\"]", NULL, 'Day element found.');
-    $this->assertOptionSelected("edit-$field_name-$langcode-0-value-day", '', 'No day selected.');
-    $this->assertFieldByXPath("//*[@id=\"edit-$field_name-$langcode-0-value-hour\"]", NULL, 'Hour element found.');
-    $this->assertOptionSelected("edit-$field_name-$langcode-0-value-hour", '', 'No hour selected.');
-    $this->assertFieldByXPath("//*[@id=\"edit-$field_name-$langcode-0-value-minute\"]", NULL, 'Minute element found.');
-    $this->assertOptionSelected("edit-$field_name-$langcode-0-value-minute", '', 'No minute selected.');
-    $this->assertNoFieldByXPath("//*[@id=\"edit-$field_name-$langcode-0-value-second\"]", NULL, 'Second element not found.');
-    $this->assertFieldByXPath("//*[@id=\"edit-$field_name-$langcode-0-value-ampm\"]", NULL, 'AMPM element found.');
-    $this->assertOptionSelected("edit-$field_name-$langcode-0-value-ampm", '', 'No ampm selected.');
-
-    // Submit a valid date and ensure it is accepted.
-    $date_value = array('year' => 2012, 'month' => 12, 'day' => 31, 'hour' => 5, 'minute' => 15);
-    $date = new DrupalDateTime($date_value);
-
-    $edit = array();
-    // Add the ampm indicator since we are testing 12 hour time.
-    $date_value['ampm'] = 'am';
-    foreach ($date_value as $part => $value) {
-      $edit["{$this->field['field_name']}[$langcode][0][value][$part]"] = $value;
-    }
-
-    $this->drupalPost(NULL, $edit, t('Save'));
-    preg_match('|test-entity/manage/(\d+)/edit|', $this->url, $match);
-    $id = $match[1];
-    $this->assertRaw(t('test_entity @id has been created.', array('@id' => $id)));
-
-    $this->assertOptionSelected("edit-$field_name-$langcode-0-value-year", '2012', 'Correct year selected.');
-    $this->assertOptionSelected("edit-$field_name-$langcode-0-value-month", '12', 'Correct month selected.');
-    $this->assertOptionSelected("edit-$field_name-$langcode-0-value-day", '31', 'Correct day selected.');
-    $this->assertOptionSelected("edit-$field_name-$langcode-0-value-hour", '5', 'Correct hour selected.');
-    $this->assertOptionSelected("edit-$field_name-$langcode-0-value-minute", '15', 'Correct minute selected.');
-    $this->assertOptionSelected("edit-$field_name-$langcode-0-value-ampm", 'am', 'Correct ampm selected.');
-  }
-
-  /**
-   * Test default value functionality.
-   */
-  function testDefaultValue() {
-
-    // Change the field to a datetime field.
-    $this->field['settings']['datetime_type'] = 'datetime';
-    field_update_field($this->field);
-
-    // Set the default value to 'now'.
-    $this->instance['settings']['default_value'] = 'now';
-    $this->instance['default_value_function'] = 'datetime_default_value';
-    field_update_instance($this->instance);
-
-    // Display creation form.
-    $date = new DrupalDateTime();
-    $date_format = 'Y-m-d';
-    $this->drupalGet('test-entity/add/test_bundle');
-    $langcode = LANGUAGE_NOT_SPECIFIED;
-
-    // See if current date is set. We cannot test for the precise time because
-    // it may be a few seconds between the time the comparison date is created
-    // and the form date, so we just test the date and that the time is not
-    // empty.
-    $this->assertFieldByName("{$this->field['field_name']}[$langcode][0][value][date]", $date->format($date_format), 'Date element found.');
-    $this->assertNoFieldByName("{$this->field['field_name']}[$langcode][0][value][time]", '', 'Time element found.');
-
-    // Set the default value to 'blank'.
-    $this->instance['settings']['default_value'] = 'blank';
-    field_update_instance($this->instance);
-
-    // Display creation form.
-    $date = new DrupalDateTime();
-    $this->drupalGet('test-entity/add/test_bundle');
-
-    // See that no date is set.
-    $this->assertFieldByName("{$this->field['field_name']}[$langcode][0][value][date]", '', 'Date element found.');
-    $this->assertFieldByName("{$this->field['field_name']}[$langcode][0][value][time]", '', 'Time element found.');
-  }
-
-  /**
-   * Test that invalid values are caught and marked as invalid.
-   */
-  function testInvalidField() {
-
-    // Change the field to a datetime field.
-    $this->field['settings']['datetime_type'] = 'datetime';
-    field_update_field($this->field);
-
-    // Display creation form.
-    $this->drupalGet('test-entity/add/test_bundle');
-    $langcode = LANGUAGE_NOT_SPECIFIED;
-    $this->assertFieldByName("{$this->field['field_name']}[$langcode][0][value][date]", '', 'Date element found.');
-    $this->assertFieldByName("{$this->field['field_name']}[$langcode][0][value][time]", '', 'Time element found.');
-
-    // Submit invalid dates and ensure they is not accepted.
-    $date_value = '';
-    $edit = array(
-      "{$this->field['field_name']}[$langcode][0][value][date]" => $date_value,
-      "{$this->field['field_name']}[$langcode][0][value][time]" => '12:00:00',
-    );
-    $this->drupalPost(NULL, $edit, t('Save'));
-    $this->assertText('date is invalid', 'Empty date value has been caught.');
-
-    $date_value = 'aaaa-12-01';
-    $edit = array(
-      "{$this->field['field_name']}[$langcode][0][value][date]" => $date_value,
-      "{$this->field['field_name']}[$langcode][0][value][time]" => '00:00:00',
-    );
-    $this->drupalPost(NULL, $edit, t('Save'));
-    $this->assertText('date is invalid', format_string('Invalid year value %date has been caught.', array('%date' => $date_value)));
-
-    $date_value = '2012-75-01';
-    $edit = array(
-      "{$this->field['field_name']}[$langcode][0][value][date]" => $date_value,
-      "{$this->field['field_name']}[$langcode][0][value][time]" => '00:00:00',
-    );
-    $this->drupalPost(NULL, $edit, t('Save'));
-    $this->assertText('date is invalid', format_string('Invalid month value %date has been caught.', array('%date' => $date_value)));
-
-    $date_value = '2012-12-99';
-    $edit = array(
-      "{$this->field['field_name']}[$langcode][0][value][date]" => $date_value,
-      "{$this->field['field_name']}[$langcode][0][value][time]" => '00:00:00',
-    );
-    $this->drupalPost(NULL, $edit, t('Save'));
-    $this->assertText('date is invalid', format_string('Invalid day value %date has been caught.', array('%date' => $date_value)));
-
-    $date_value = '2012-12-01';
-    $time_value = '';
-    $edit = array(
-      "{$this->field['field_name']}[$langcode][0][value][date]" => $date_value,
-      "{$this->field['field_name']}[$langcode][0][value][time]" => $time_value,
-    );
-    $this->drupalPost(NULL, $edit, t('Save'));
-    $this->assertText('date is invalid', 'Empty time value has been caught.');
-
-    $date_value = '2012-12-01';
-    $time_value = '49:00:00';
-    $edit = array(
-      "{$this->field['field_name']}[$langcode][0][value][date]" => $date_value,
-      "{$this->field['field_name']}[$langcode][0][value][time]" => $time_value,
-    );
-    $this->drupalPost(NULL, $edit, t('Save'));
-    $this->assertText('date is invalid', format_string('Invalid hour value %time has been caught.', array('%time' => $time_value)));
-
-    $date_value = '2012-12-01';
-    $time_value = '12:99:00';
-    $edit = array(
-      "{$this->field['field_name']}[$langcode][0][value][date]" => $date_value,
-      "{$this->field['field_name']}[$langcode][0][value][time]" => $time_value,
-    );
-    $this->drupalPost(NULL, $edit, t('Save'));
-    $this->assertText('date is invalid', format_string('Invalid minute value %time has been caught.', array('%time' => $time_value)));
-
-    $date_value = '2012-12-01';
-    $time_value = '12:15:99';
-    $edit = array(
-      "{$this->field['field_name']}[$langcode][0][value][date]" => $date_value,
-      "{$this->field['field_name']}[$langcode][0][value][time]" => $time_value,
-    );
-    $this->drupalPost(NULL, $edit, t('Save'));
-    $this->assertText('date is invalid', format_string('Invalid second value %time has been caught.', array('%time' => $time_value)));
-  }
-
-  /**
-   * Renders a test_entity and sets the output in the internal browser.
-   *
-   * @param int $id
-   *   The test_entity ID to render.
-   * @param string $view_mode
-   *   (optional) The view mode to use for rendering. Defaults to 'full'.
-   * @param bool $reset
-   *   (optional) Whether to reset the test_entity controller cache. Defaults to
-   *   TRUE to simplify testing.
-   */
-  protected function renderTestEntity($id, $view_mode = 'full', $reset = TRUE) {
-    if ($reset) {
-      entity_get_controller('test_entity')->resetCache(array($id));
-    }
-    $entity = field_test_entity_test_load($id);
-    $display = entity_get_display('test_entity', $entity->bundle(), 'full');
-    field_attach_prepare_view('test_entity', array($entity->id() => $entity), array($entity->bundle() => $display), $view_mode);
-    $entity->content = field_attach_view($entity, $display, $view_mode);
-
-    $output = drupal_render($entity->content);
-    $this->drupalSetContent($output);
-    $this->verbose($output);
-  }
-
-}
diff --git a/core/modules/datetime/lib/Drupal/datetime/Tests/DatetimeFieldTest.php b/core/modules/datetime/lib/Drupal/datetime/Tests/DatetimeFieldTest.php
new file mode 100644
index 0000000..968f062
--- /dev/null
+++ b/core/modules/datetime/lib/Drupal/datetime/Tests/DatetimeFieldTest.php
@@ -0,0 +1,435 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\datetime\Tests\DatetimeFieldTest.
+ */
+
+namespace Drupal\datetime\Tests;
+
+use Drupal\simpletest\WebTestBase;
+use Drupal\Core\Datetime\DrupalDateTime;
+
+/**
+ * Tests Datetime field functionality.
+ */
+class DatetimeFieldTest extends WebTestBase {
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = array('node', 'field_test', 'datetime', 'field_ui', 'entity_test');
+
+  /**
+   * A field to use in this test class.
+   *
+   * @var \Drupal\Core\Datetime\DrupalDateTime
+   */
+  protected $field;
+
+  public static function getInfo() {
+    return array(
+      'name'  => 'Datetime Field',
+      'description'  => 'Tests datetime field functionality.',
+      'group' => 'Datetime',
+    );
+  }
+
+  function setUp() {
+    parent::setUp();
+
+    $web_user = $this->drupalCreateUser(array(
+      'view test entity',
+      'administer entity_test content',
+      'administer content types',
+    ));
+    $this->drupalLogin($web_user);
+
+    // Create a field with settings to validate.
+    $this->field = array(
+      'field_name' => drupal_strtolower($this->randomName()),
+      'type' => 'datetime',
+      'settings' => array('datetime_type' => 'date'),
+    );
+    field_create_field($this->field);
+    $this->instance = array(
+      'field_name' => $this->field['field_name'],
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
+      'widget' => array(
+        'type' => 'datetime_default',
+      ),
+      'settings' => array(
+        'default_value' => 'blank',
+      ),
+    );
+    field_create_instance($this->instance);
+
+    $this->display_options = array(
+      'type' => 'datetime_default',
+      'label' => 'hidden',
+      'settings' => array('format_type' => 'medium'),
+    );
+    entity_get_display($this->instance['entity_type'], $this->instance['bundle'], 'full')
+      ->setComponent($this->field['field_name'], $this->display_options)
+      ->save();
+  }
+
+  /**
+   * Tests date field functionality.
+   */
+  function testDateField() {
+
+    // Display creation form.
+    $this->drupalGet('entity_test/add');
+    $langcode = LANGUAGE_NOT_SPECIFIED;
+    $this->assertFieldByName("{$this->field['field_name']}[$langcode][0][value][date]", '', 'Date element found.');
+    $this->assertNoFieldByName("{$this->field['field_name']}[$langcode][0][value][time]", '', 'Time element not found.');
+
+    // Submit a valid date and ensure it is accepted.
+    $value = '2012-12-31 00:00:00';
+    $date = new DrupalDateTime($value);
+    $format_type = $date->canUseIntl() ? DrupalDateTime::INTL : DrupalDateTime::PHP;
+    $date_format = config('system.date')->get('formats.html_date.pattern.' . $format_type);
+    $time_format = config('system.date')->get('formats.html_time.pattern.' . $format_type);
+
+    $edit = array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
+      "{$this->field['field_name']}[$langcode][0][value][date]" => $date->format($date_format),
+    );
+    $this->drupalPost(NULL, $edit, t('Save'));
+    preg_match('|entity_test/manage/(\d+)/edit|', $this->url, $match);
+    $id = $match[1];
+    $this->assertText(t('entity_test @id has been created.', array('@id' => $id)));
+    $this->assertRaw($date->format($date_format));
+    $this->assertNoRaw($date->format($time_format));
+
+    // The expected values will use the default time.
+    datetime_date_default_time($date);
+
+    // Verify that the date is output according to the formatter settings.
+    $options = array(
+      'format_type' => array('short', 'medium', 'long'),
+    );
+    foreach ($options as $setting => $values) {
+      foreach ($values as $new_value) {
+        // Update the entity display settings.
+        $this->display_options['settings'] = array($setting => $new_value);
+        $display = entity_get_display($this->instance['entity_type'], $this->instance['bundle'], 'full')
+          ->setComponent($this->instance['field_name'], $this->display_options)
+          ->save();
+
+        $this->renderTestEntity($id);
+        switch ($setting) {
+          case 'format_type':
+            // Verify that a date is displayed.
+            $expected = format_date($date->getTimestamp(), $new_value);
+            $this->renderTestEntity($id);
+            $this->assertText($expected, format_string('Formatted date field using %value format displayed as %expected.', array('%value' => $new_value, '%expected' => $expected)));
+            break;
+        }
+      }
+    }
+
+    // Verify that the plain formatter works.
+    $this->display_options['type'] = 'datetime_plain';
+    $display = entity_get_display($this->instance['entity_type'], $this->instance['bundle'], 'full')
+      ->setComponent($this->instance['field_name'], $this->display_options)
+      ->save();
+    $expected = $date->format(DATETIME_DATE_STORAGE_FORMAT);
+    $this->renderTestEntity($id);
+    $this->assertText($expected, format_string('Formatted date field using plain format displayed as %expected.', array('%expected' => $expected)));
+  }
+
+  /**
+   * Tests date and time field.
+   */
+  function testDatetimeField() {
+
+    // Change the field to a datetime field.
+    $this->field['settings']['datetime_type'] = 'datetime';
+    field_update_field($this->field);
+
+    // Display creation form.
+    $this->drupalGet('entity_test/add');
+    $langcode = LANGUAGE_NOT_SPECIFIED;
+    $this->assertFieldByName("{$this->field['field_name']}[$langcode][0][value][date]", '', 'Date element found.');
+    $this->assertFieldByName("{$this->field['field_name']}[$langcode][0][value][time]", '', 'Time element found.');
+
+    // Submit a valid date and ensure it is accepted.
+    $value = '2012-12-31 00:00:00';
+    $date = new DrupalDateTime($value);
+    $format_type = $date->canUseIntl() ? DrupalDateTime::INTL : DrupalDateTime::PHP;
+    $date_format = config('system.date')->get('formats.html_date.pattern.' . $format_type);
+    $time_format = config('system.date')->get('formats.html_time.pattern.' . $format_type);
+
+    $edit = array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
+      "{$this->field['field_name']}[$langcode][0][value][date]" => $date->format($date_format),
+      "{$this->field['field_name']}[$langcode][0][value][time]" => $date->format($time_format),
+    );
+    $this->drupalPost(NULL, $edit, t('Save'));
+    preg_match('|entity_test/manage/(\d+)/edit|', $this->url, $match);
+    $id = $match[1];
+    $this->assertText(t('entity_test @id has been created.', array('@id' => $id)));
+    $this->assertRaw($date->format($date_format));
+    $this->assertRaw($date->format($time_format));
+
+    // Verify that the date is output according to the formatter settings.
+    $options = array(
+      'format_type' => array('short', 'medium', 'long'),
+    );
+    foreach ($options as $setting => $values) {
+      foreach ($values as $new_value) {
+        // Update the entity display settings.
+        $this->display_options['settings'] = array($setting => $new_value);
+        $display = entity_get_display($this->instance['entity_type'], $this->instance['bundle'], 'full')
+          ->setComponent($this->instance['field_name'], $this->display_options)
+          ->save();
+
+        $this->renderTestEntity($id);
+        switch ($setting) {
+          case 'format_type':
+            // Verify that a date is displayed.
+            $expected = format_date($date->getTimestamp(), $new_value);
+            $this->renderTestEntity($id);
+            $this->assertText($expected, format_string('Formatted date field using %value format displayed as %expected.', array('%value' => $new_value, '%expected' => $expected)));
+            break;
+        }
+      }
+    }
+
+    // Verify that the plain formatter works.
+    $this->display_options['type'] = 'datetime_plain';
+    $display = entity_get_display($this->instance['entity_type'], $this->instance['bundle'], 'full')
+      ->setComponent($this->instance['field_name'], $this->display_options)
+      ->save();
+    $expected = $date->format(DATETIME_DATETIME_STORAGE_FORMAT);
+    $this->renderTestEntity($id);
+    $this->assertText($expected, format_string('Formatted date field using plain format displayed as %expected.', array('%expected' => $expected)));
+  }
+
+  /**
+   * Tests Date List Widget functionality.
+   */
+  function testDatelistWidget() {
+
+    // Change the field to a datetime field.
+    $this->field['settings']['datetime_type'] = 'datetime';
+    field_update_field($this->field);
+
+    // Change the widget to a datelist widget.
+    $increment = 1;
+    $date_order = 'YMD';
+    $time_type = '12';
+
+    $this->instance['widget']['type'] = 'datetime_datelist';
+    $this->instance['widget']['settings'] = array(
+      'increment' => $increment,
+      'date_order' => $date_order,
+      'time_type' => $time_type,
+    );
+    field_update_instance($this->instance);
+    field_cache_clear();
+
+    // Display creation form.
+    $this->drupalGet('entity_test/add');
+    $field_name = $this->field['field_name'];
+    $langcode = LANGUAGE_NOT_SPECIFIED;
+
+    $this->assertFieldByXPath("//*[@id=\"edit-$field_name-$langcode-0-value-year\"]", NULL, 'Year element found.');
+    $this->assertOptionSelected("edit-$field_name-$langcode-0-value-year", '', 'No year selected.');
+    $this->assertFieldByXPath("//*[@id=\"edit-$field_name-$langcode-0-value-month\"]", NULL, 'Month element found.');
+    $this->assertOptionSelected("edit-$field_name-$langcode-0-value-month", '', 'No month selected.');
+    $this->assertFieldByXPath("//*[@id=\"edit-$field_name-$langcode-0-value-day\"]", NULL, 'Day element found.');
+    $this->assertOptionSelected("edit-$field_name-$langcode-0-value-day", '', 'No day selected.');
+    $this->assertFieldByXPath("//*[@id=\"edit-$field_name-$langcode-0-value-hour\"]", NULL, 'Hour element found.');
+    $this->assertOptionSelected("edit-$field_name-$langcode-0-value-hour", '', 'No hour selected.');
+    $this->assertFieldByXPath("//*[@id=\"edit-$field_name-$langcode-0-value-minute\"]", NULL, 'Minute element found.');
+    $this->assertOptionSelected("edit-$field_name-$langcode-0-value-minute", '', 'No minute selected.');
+    $this->assertNoFieldByXPath("//*[@id=\"edit-$field_name-$langcode-0-value-second\"]", NULL, 'Second element not found.');
+    $this->assertFieldByXPath("//*[@id=\"edit-$field_name-$langcode-0-value-ampm\"]", NULL, 'AMPM element found.');
+    $this->assertOptionSelected("edit-$field_name-$langcode-0-value-ampm", '', 'No ampm selected.');
+
+    // Submit a valid date and ensure it is accepted.
+    $date_value = array('year' => 2012, 'month' => 12, 'day' => 31, 'hour' => 5, 'minute' => 15);
+    $date = new DrupalDateTime($date_value);
+
+    $edit = array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
+    );
+    // Add the ampm indicator since we are testing 12 hour time.
+    $date_value['ampm'] = 'am';
+    foreach ($date_value as $part => $value) {
+      $edit["{$this->field['field_name']}[$langcode][0][value][$part]"] = $value;
+    }
+
+    $this->drupalPost(NULL, $edit, t('Save'));
+    preg_match('|entity_test/manage/(\d+)/edit|', $this->url, $match);
+    $id = $match[1];
+    $this->assertText(t('entity_test @id has been created.', array('@id' => $id)));
+
+    $this->assertOptionSelected("edit-$field_name-$langcode-0-value-year", '2012', 'Correct year selected.');
+    $this->assertOptionSelected("edit-$field_name-$langcode-0-value-month", '12', 'Correct month selected.');
+    $this->assertOptionSelected("edit-$field_name-$langcode-0-value-day", '31', 'Correct day selected.');
+    $this->assertOptionSelected("edit-$field_name-$langcode-0-value-hour", '5', 'Correct hour selected.');
+    $this->assertOptionSelected("edit-$field_name-$langcode-0-value-minute", '15', 'Correct minute selected.');
+    $this->assertOptionSelected("edit-$field_name-$langcode-0-value-ampm", 'am', 'Correct ampm selected.');
+  }
+
+  /**
+   * Test default value functionality.
+   */
+  function testDefaultValue() {
+
+    // Change the field to a datetime field.
+    $this->field['settings']['datetime_type'] = 'datetime';
+    field_update_field($this->field);
+
+    // Set the default value to 'now'.
+    $this->instance['settings']['default_value'] = 'now';
+    $this->instance['default_value_function'] = 'datetime_default_value';
+    field_update_instance($this->instance);
+
+    // Display creation form.
+    $date = new DrupalDateTime();
+    $date_format = 'Y-m-d';
+    $this->drupalGet('entity_test/add');
+    $langcode = LANGUAGE_NOT_SPECIFIED;
+
+    // See if current date is set. We cannot test for the precise time because
+    // it may be a few seconds between the time the comparison date is created
+    // and the form date, so we just test the date and that the time is not
+    // empty.
+    $this->assertFieldByName("{$this->field['field_name']}[$langcode][0][value][date]", $date->format($date_format), 'Date element found.');
+    $this->assertNoFieldByName("{$this->field['field_name']}[$langcode][0][value][time]", '', 'Time element found.');
+
+    // Set the default value to 'blank'.
+    $this->instance['settings']['default_value'] = 'blank';
+    field_update_instance($this->instance);
+
+    // Display creation form.
+    $date = new DrupalDateTime();
+    $this->drupalGet('entity_test/add');
+
+    // See that no date is set.
+    $this->assertFieldByName("{$this->field['field_name']}[$langcode][0][value][date]", '', 'Date element found.');
+    $this->assertFieldByName("{$this->field['field_name']}[$langcode][0][value][time]", '', 'Time element found.');
+  }
+
+  /**
+   * Test that invalid values are caught and marked as invalid.
+   */
+  function testInvalidField() {
+
+    // Change the field to a datetime field.
+    $this->field['settings']['datetime_type'] = 'datetime';
+    field_update_field($this->field);
+
+    // Display creation form.
+    $this->drupalGet('entity_test/add');
+    $langcode = LANGUAGE_NOT_SPECIFIED;
+    $this->assertFieldByName("{$this->field['field_name']}[$langcode][0][value][date]", '', 'Date element found.');
+    $this->assertFieldByName("{$this->field['field_name']}[$langcode][0][value][time]", '', 'Time element found.');
+
+    // Submit invalid dates and ensure they is not accepted.
+    $date_value = '';
+    $edit = array(
+      "{$this->field['field_name']}[$langcode][0][value][date]" => $date_value,
+      "{$this->field['field_name']}[$langcode][0][value][time]" => '12:00:00',
+    );
+    $this->drupalPost(NULL, $edit, t('Save'));
+    $this->assertText('date is invalid', 'Empty date value has been caught.');
+
+    $date_value = 'aaaa-12-01';
+    $edit = array(
+      "{$this->field['field_name']}[$langcode][0][value][date]" => $date_value,
+      "{$this->field['field_name']}[$langcode][0][value][time]" => '00:00:00',
+    );
+    $this->drupalPost(NULL, $edit, t('Save'));
+    $this->assertText('date is invalid', format_string('Invalid year value %date has been caught.', array('%date' => $date_value)));
+
+    $date_value = '2012-75-01';
+    $edit = array(
+      "{$this->field['field_name']}[$langcode][0][value][date]" => $date_value,
+      "{$this->field['field_name']}[$langcode][0][value][time]" => '00:00:00',
+    );
+    $this->drupalPost(NULL, $edit, t('Save'));
+    $this->assertText('date is invalid', format_string('Invalid month value %date has been caught.', array('%date' => $date_value)));
+
+    $date_value = '2012-12-99';
+    $edit = array(
+      "{$this->field['field_name']}[$langcode][0][value][date]" => $date_value,
+      "{$this->field['field_name']}[$langcode][0][value][time]" => '00:00:00',
+    );
+    $this->drupalPost(NULL, $edit, t('Save'));
+    $this->assertText('date is invalid', format_string('Invalid day value %date has been caught.', array('%date' => $date_value)));
+
+    $date_value = '2012-12-01';
+    $time_value = '';
+    $edit = array(
+      "{$this->field['field_name']}[$langcode][0][value][date]" => $date_value,
+      "{$this->field['field_name']}[$langcode][0][value][time]" => $time_value,
+    );
+    $this->drupalPost(NULL, $edit, t('Save'));
+    $this->assertText('date is invalid', 'Empty time value has been caught.');
+
+    $date_value = '2012-12-01';
+    $time_value = '49:00:00';
+    $edit = array(
+      "{$this->field['field_name']}[$langcode][0][value][date]" => $date_value,
+      "{$this->field['field_name']}[$langcode][0][value][time]" => $time_value,
+    );
+    $this->drupalPost(NULL, $edit, t('Save'));
+    $this->assertText('date is invalid', format_string('Invalid hour value %time has been caught.', array('%time' => $time_value)));
+
+    $date_value = '2012-12-01';
+    $time_value = '12:99:00';
+    $edit = array(
+      "{$this->field['field_name']}[$langcode][0][value][date]" => $date_value,
+      "{$this->field['field_name']}[$langcode][0][value][time]" => $time_value,
+    );
+    $this->drupalPost(NULL, $edit, t('Save'));
+    $this->assertText('date is invalid', format_string('Invalid minute value %time has been caught.', array('%time' => $time_value)));
+
+    $date_value = '2012-12-01';
+    $time_value = '12:15:99';
+    $edit = array(
+      "{$this->field['field_name']}[$langcode][0][value][date]" => $date_value,
+      "{$this->field['field_name']}[$langcode][0][value][time]" => $time_value,
+    );
+    $this->drupalPost(NULL, $edit, t('Save'));
+    $this->assertText('date is invalid', format_string('Invalid second value %time has been caught.', array('%time' => $time_value)));
+  }
+
+  /**
+   * Renders a entity_test and sets the output in the internal browser.
+   *
+   * @param int $id
+   *   The entity_test ID to render.
+   * @param string $view_mode
+   *   (optional) The view mode to use for rendering. Defaults to 'full'.
+   * @param bool $reset
+   *   (optional) Whether to reset the entity_test controller cache. Defaults to
+   *   TRUE to simplify testing.
+   */
+  protected function renderTestEntity($id, $view_mode = 'full', $reset = TRUE) {
+    if ($reset) {
+      entity_get_controller('entity_test')->resetCache(array($id));
+    }
+    $entity = entity_load('entity_test', $id);
+    $display = entity_get_display('entity_test', $entity->bundle(), 'full');
+    field_attach_prepare_view('entity_test', array($entity->id() => $entity), array($entity->bundle() => $display), $view_mode);
+    $entity->content = field_attach_view($entity, $display, $view_mode);
+
+    $output = drupal_render($entity->content);
+    $this->drupalSetContent($output);
+    $this->verbose($output);
+  }
+
+}
diff --git a/core/modules/edit/lib/Drupal/edit/MetadataGenerator.php b/core/modules/edit/lib/Drupal/edit/MetadataGenerator.php
index 3ec8ce2..df0217a 100644
--- a/core/modules/edit/lib/Drupal/edit/MetadataGenerator.php
+++ b/core/modules/edit/lib/Drupal/edit/MetadataGenerator.php
@@ -69,8 +69,7 @@ public function generate(EntityInterface $entity, FieldInstance $instance, $lang
 
     // Early-return if no editor is available.
     $formatter_id = entity_get_render_display($entity, $view_mode)->getFormatter($instance['field_name'])->getPluginId();
-    $items = $entity->get($field_name);
-    $items = $items[$langcode];
+    $items = $entity->get($field_name)->getValue();
     $editor_id = $this->editorSelector->getEditor($formatter_id, $instance, $items);
     if (!isset($editor_id)) {
       return array('access' => FALSE);
diff --git a/core/modules/edit/lib/Drupal/edit/Tests/EditTestBase.php b/core/modules/edit/lib/Drupal/edit/Tests/EditTestBase.php
index c3a91fb..d614829 100644
--- a/core/modules/edit/lib/Drupal/edit/Tests/EditTestBase.php
+++ b/core/modules/edit/lib/Drupal/edit/Tests/EditTestBase.php
@@ -20,8 +20,7 @@ class EditTestBase extends DrupalUnitTestBase {
    *
    * @var array
    */
-  public static $modules = array('system', 'entity', 'field', 'field_sql_storage', 'field_test', 'number', 'text', 'edit');
-
+  public static $modules = array('system', 'entity', 'entity_test', 'field', 'field_sql_storage', 'field_test', 'number', 'text', 'edit');
   /**
    * Sets the default field storage backend for fields created during tests.
    */
@@ -30,7 +29,7 @@ function setUp() {
 
     $this->installSchema('system', 'variable');
     $this->installSchema('field', array('field_config', 'field_config_instance'));
-    $this->installSchema('field_test', 'test_entity');
+    $this->installSchema('entity_test', 'entity_test');
 
     // Set default storage backend.
     variable_set('field_storage_default', $this->default_storage);
@@ -69,8 +68,8 @@ function createFieldWithInstance($field_name, $type, $cardinality, $label, $inst
     $instance = $field_name . '_instance';
     $this->$instance = array(
       'field_name' => $field_name,
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
       'label' => $label,
       'description' => $label,
       'weight' => mt_rand(0, 127),
@@ -83,7 +82,7 @@ function createFieldWithInstance($field_name, $type, $cardinality, $label, $inst
     );
     field_create_instance($this->$instance);
 
-    entity_get_display('test_entity', 'test_bundle', 'default')
+    entity_get_display('entity_test', 'entity_test', 'default')
       ->setComponent($field_name, array(
         'label' => 'above',
         'type' => $formatter_type,
diff --git a/core/modules/edit/lib/Drupal/edit/Tests/EditorSelectionTest.php b/core/modules/edit/lib/Drupal/edit/Tests/EditorSelectionTest.php
index fdddec0..e7a6db1 100644
--- a/core/modules/edit/lib/Drupal/edit/Tests/EditorSelectionTest.php
+++ b/core/modules/edit/lib/Drupal/edit/Tests/EditorSelectionTest.php
@@ -49,8 +49,8 @@ function setUp() {
    * editor that Edit selects.
    */
   protected function getSelectedEditor($items, $field_name, $view_mode = 'default') {
-    $options = entity_get_display('test_entity', 'test_bundle', $view_mode)->getComponent($field_name);
-    $field_instance = field_info_instance('test_entity', $field_name, 'test_bundle');
+    $options = entity_get_display('entity_test', 'entity_test', $view_mode)->getComponent($field_name);
+    $field_instance = field_info_instance('entity_test', $field_name, 'entity_test');
     return $this->editorSelector->getEditor($options['type'], $field_instance, $items);
   }
 
diff --git a/core/modules/edit/lib/Drupal/edit/Tests/MetadataGeneratorTest.php b/core/modules/edit/lib/Drupal/edit/Tests/MetadataGeneratorTest.php
index 529d535..e41e6ed 100644
--- a/core/modules/edit/lib/Drupal/edit/Tests/MetadataGeneratorTest.php
+++ b/core/modules/edit/lib/Drupal/edit/Tests/MetadataGeneratorTest.php
@@ -96,12 +96,12 @@ function testSimpleEntityType() {
     );
 
     // Create an entity with values for this text field.
-    $this->entity = field_test_create_entity();
+    $this->entity = entity_create('entity_test', array());
     $this->is_new = TRUE;
-    $this->entity->{$field_1_name}[LANGUAGE_NOT_SPECIFIED] = array(array('value' => 'Test'));
-    $this->entity->{$field_2_name}[LANGUAGE_NOT_SPECIFIED] = array(array('value' => 42));
-    field_test_entity_save($this->entity);
-    $entity = entity_load('test_entity', $this->entity->ftid);
+    $this->entity->{$field_1_name}->value = 'Test';
+    $this->entity->{$field_2_name}->value = 42;
+    $this->entity->save();
+    $entity = entity_load('entity_test', $this->entity->id());
 
     // Verify metadata for field 1.
     $instance_1 = field_info_instance($entity->entityType(), $field_1_name, $entity->bundle());
@@ -110,7 +110,7 @@ function testSimpleEntityType() {
       'access' => TRUE,
       'label' => 'Simple text field',
       'editor' => 'direct',
-      'aria' => 'Entity test_entity 1, field Simple text field',
+      'aria' => 'Entity entity_test 1, field Simple text field',
     );
     $this->assertEqual($expected_1, $metadata_1, 'The correct metadata is generated for the first field.');
 
@@ -121,7 +121,7 @@ function testSimpleEntityType() {
       'access' => TRUE,
       'label' => 'Simple number field',
       'editor' => 'form',
-      'aria' => 'Entity test_entity 1, field Simple number field',
+      'aria' => 'Entity entity_test 1, field Simple number field',
     );
     $this->assertEqual($expected_2, $metadata_2, 'The correct metadata is generated for the second field.');
   }
@@ -164,11 +164,11 @@ function testEditorWithCustomMetadata() {
     $full_html_format->save();
 
     // Create an entity with values for this rich text field.
-    $this->entity = field_test_create_entity();
-    $this->is_new = TRUE;
-    $this->entity->{$field_name}[LANGUAGE_NOT_SPECIFIED] = array(array('value' => 'Test', 'format' => 'full_html'));
-    field_test_entity_save($this->entity);
-    $entity = entity_load('test_entity', $this->entity->ftid);
+    $this->entity = entity_create('entity_test', array());
+    $this->entity->{$field_name}->value = 'Test';
+    $this->entity->{$field_name}->format = 'full_html';
+    $this->entity->save();
+    $entity = entity_load('entity_test', $this->entity->id());
 
     // Verify metadata.
     $instance = field_info_instance($entity->entityType(), $field_name, $entity->bundle());
@@ -177,7 +177,7 @@ function testEditorWithCustomMetadata() {
       'access' => TRUE,
       'label' => 'Rich text field',
       'editor' => 'wysiwyg',
-      'aria' => 'Entity test_entity 1, field Rich text field',
+      'aria' => 'Entity entity_test 1, field Rich text field',
       'custom' => array(
         'format' => 'full_html'
       ),
diff --git a/core/modules/email/lib/Drupal/email/Tests/EmailFieldTest.php b/core/modules/email/lib/Drupal/email/Tests/EmailFieldTest.php
index c719c97..8548c2a 100644
--- a/core/modules/email/lib/Drupal/email/Tests/EmailFieldTest.php
+++ b/core/modules/email/lib/Drupal/email/Tests/EmailFieldTest.php
@@ -19,7 +19,7 @@ class EmailFieldTest extends WebTestBase {
    *
    * @var array
    */
-  public static $modules = array('node', 'field_test', 'email', 'field_ui');
+  public static $modules = array('node', 'entity_test', 'email', 'field_ui');
 
   public static function getInfo() {
     return array(
@@ -33,8 +33,8 @@ function setUp() {
     parent::setUp();
 
     $this->web_user = $this->drupalCreateUser(array(
-      'access field_test content',
-      'administer field_test content',
+      'view test entity',
+      'administer entity_test content',
       'administer content types',
     ));
     $this->drupalLogin($this->web_user);
@@ -52,8 +52,8 @@ function testEmailField() {
     field_create_field($this->field);
     $this->instance = array(
       'field_name' => $this->field['field_name'],
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
       'widget' => array(
         'type' => 'email_default',
         'settings' => array(
@@ -63,14 +63,14 @@ function testEmailField() {
     );
     field_create_instance($this->instance);
     // Create a display for the full view mode.
-    entity_get_display('test_entity', 'test_bundle', 'full')
+    entity_get_display('entity_test', 'entity_test', 'full')
       ->setComponent($this->field['field_name'], array(
         'type' => 'email_mailto',
       ))
       ->save();
 
     // Display creation form.
-    $this->drupalGet('test-entity/add/test_bundle');
+    $this->drupalGet('entity_test/add');
     $langcode = LANGUAGE_NOT_SPECIFIED;
     $this->assertFieldByName("{$this->field['field_name']}[$langcode][0][value]", '', 'Widget found.');
     $this->assertRaw('placeholder="example@example.com"');
@@ -78,16 +78,18 @@ function testEmailField() {
     // Submit a valid e-mail address and ensure it is accepted.
     $value = 'test@example.com';
     $edit = array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
       "{$this->field['field_name']}[$langcode][0][value]" => $value,
     );
     $this->drupalPost(NULL, $edit, t('Save'));
-    preg_match('|test-entity/manage/(\d+)/edit|', $this->url, $match);
+    preg_match('|entity_test/manage/(\d+)/edit|', $this->url, $match);
     $id = $match[1];
-    $this->assertRaw(t('test_entity @id has been created.', array('@id' => $id)));
+    $this->assertText(t('entity_test @id has been created.', array('@id' => $id)));
     $this->assertRaw($value);
 
     // Verify that a mailto link is displayed.
-    $entity = field_test_entity_test_load($id);
+    $entity = entity_load('entity_test', $id);
     $display = entity_get_display($entity->entityType(), $entity->bundle(), 'full');
     $entity->content = field_attach_view($entity, $display);
     $this->drupalSetContent(drupal_render($entity->content));
diff --git a/core/modules/field/field.module b/core/modules/field/field.module
index 6cdd628..6731991 100644
--- a/core/modules/field/field.module
+++ b/core/modules/field/field.module
@@ -393,7 +393,7 @@ function field_entity_create(EntityInterface $entity) {
   $info = $entity->entityInfo();
   if (!empty($info['fieldable'])) {
     foreach ($entity->getTranslationLanguages() as $langcode => $language) {
-      field_populate_default_values($entity, $langcode);
+      field_populate_default_values($entity->getBCEntity(), $langcode);
     }
   }
 }
diff --git a/core/modules/field/lib/Drupal/field/Tests/BulkDeleteTest.php b/core/modules/field/lib/Drupal/field/Tests/BulkDeleteTest.php
index 0635f38..b6df790 100644
--- a/core/modules/field/lib/Drupal/field/Tests/BulkDeleteTest.php
+++ b/core/modules/field/lib/Drupal/field/Tests/BulkDeleteTest.php
@@ -42,10 +42,10 @@ protected function convertToPartialEntities($entities, $field_name) {
       // Re-create the entity to match what is expected
       // _field_create_entity_from_ids().
       $ids = (object) array(
-        'entity_id' => $entity->ftid,
-        'revision_id' => $entity->ftvid,
-        'bundle' => $entity->fttype,
-        'entity_type' => 'test_entity',
+        'entity_id' => $entity->id(),
+        'revision_id' => $entity->getRevisionId(),
+        'bundle' => 'entity_test',
+        'entity_type' => 'entity_test',
       );
       $partial_entities[$id] = _field_create_entity_from_ids($ids);
       $partial_entities[$id]->$field_name = $entity->$field_name;
@@ -96,7 +96,7 @@ function setUp() {
     // Create two bundles.
     $this->bundles = array('bb_1' => 'bb_1', 'bb_2' => 'bb_2');
     foreach ($this->bundles as $name => $desc) {
-      field_test_create_bundle($name, $desc);
+      entity_test_create_bundle($name, $desc);
     }
 
     // Create two fields.
@@ -107,8 +107,7 @@ function setUp() {
 
     // For each bundle, create an instance of each field, and 10
     // entities with values for each field.
-    $id = 1;
-    $this->entity_type = 'test_entity';
+    $this->entity_type = 'entity_test';
     foreach ($this->bundles as $bundle) {
       foreach ($this->fields as $field) {
         $instance = array(
@@ -121,20 +120,18 @@ function setUp() {
         );
         $this->instances[] = field_create_instance($instance);
       }
-
       for ($i = 0; $i < 10; $i++) {
-        $entity = field_test_create_entity($id, $id, $bundle);
+        $entity = entity_create($this->entity_type, array('type' => $bundle));
         foreach ($this->fields as $field) {
-          $entity->{$field['field_name']}[LANGUAGE_NOT_SPECIFIED] = $this->_generateTestFieldValues($field['cardinality']);
+        $entity->{$field['field_name']}->setValue($this->_generateTestFieldValues($field['cardinality']));
         }
         $entity->save();
-        $id++;
       }
     }
-    $this->entities = entity_load_multiple($this->entity_type, range(1, $id));
+    $this->entities = entity_load_multiple($this->entity_type);
     foreach ($this->entities as $entity) {
       // Also keep track of the entities per bundle.
-      $this->entities_by_bundles[$entity->fttype][$entity->ftid] = $entity;
+      $this->entities_by_bundles[$entity->bundle()][$entity->id()] = $entity;
     }
   }
 
@@ -154,8 +151,8 @@ function testDeleteFieldInstance() {
     $factory = drupal_container()->get('entity.query');
 
     // There are 10 entities of this bundle.
-    $found = $factory->get('test_entity')
-      ->condition('fttype', $bundle)
+    $found = $factory->get('entity_test')
+      ->condition('type', $bundle)
       ->execute();
     $this->assertEqual(count($found), 10, 'Correct number of entities found before deleting');
 
@@ -169,21 +166,21 @@ function testDeleteFieldInstance() {
     $this->assertEqual($instances[0]['bundle'], $bundle, 'The deleted instance is for the correct bundle');
 
     // There are 0 entities of this bundle with non-deleted data.
-    $found = $factory->get('test_entity')
-      ->condition('fttype', $bundle)
+    $found = $factory->get('entity_test')
+      ->condition('type', $bundle)
       ->condition("$field_name.deleted", 0)
       ->execute();
     $this->assertFalse($found, 'No entities found after deleting');
 
     // There are 10 entities of this bundle when deleted fields are allowed, and
     // their values are correct.
-    $found = $factory->get('test_entity')
-      ->condition('fttype', $bundle)
+    $found = $factory->get('entity_test')
+      ->condition('type', $bundle)
       ->condition("$field_name.deleted", 1)
-      ->sort('ftid')
+      ->sort('id')
       ->execute();
     $ids = (object) array(
-      'entity_type' => 'test_entity',
+      'entity_type' => 'entity_test',
       'bundle' => $bundle,
     );
     $entities = array();
@@ -194,7 +191,7 @@ function testDeleteFieldInstance() {
     field_attach_load($this->entity_type, $entities, FIELD_LOAD_CURRENT, array('field_id' => $field['id'], 'deleted' => 1));
     $this->assertEqual(count($found), 10, 'Correct number of entities found after deleting');
     foreach ($entities as $id => $entity) {
-      $this->assertEqual($this->entities[$id]->{$field['field_name']}, $entity->{$field['field_name']}, "Entity $id with deleted data loaded correctly");
+      $this->assertEqual($this->entities[$id]->{$field['field_name']}->value, $entity->{$field['field_name']}[LANGUAGE_NOT_SPECIFIED][0]['value'], "Entity $id with deleted data loaded correctly");
     }
   }
 
@@ -223,8 +220,8 @@ function testPurgeInstance() {
       field_purge_batch($batch_size);
 
       // There are $count deleted entities left.
-      $found = entity_query('test_entity')
-        ->condition('fttype', $bundle)
+      $found = entity_query('entity_test')
+        ->condition('type', $bundle)
         ->condition($field['field_name'] . '.deleted', 1)
         ->execute();
       $this->assertEqual(count($found), $count, 'Correct number of entities found after purging 2');
diff --git a/core/modules/field/lib/Drupal/field/Tests/CrudTest.php b/core/modules/field/lib/Drupal/field/Tests/CrudTest.php
index f7c3a9c..7ff81f1 100644
--- a/core/modules/field/lib/Drupal/field/Tests/CrudTest.php
+++ b/core/modules/field/lib/Drupal/field/Tests/CrudTest.php
@@ -215,8 +215,8 @@ function testReadFields() {
     // Create an instance of the field.
     $instance_definition = array(
       'field_name' => $field_definition['field_name'],
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
     );
     field_create_instance($instance_definition);
 
@@ -285,8 +285,8 @@ function testDeleteField() {
     // Create instances for each.
     $this->instance_definition = array(
       'field_name' => $this->field['field_name'],
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
       'widget' => array(
         'type' => 'test_field_widget',
       ),
@@ -308,7 +308,7 @@ function testDeleteField() {
 
     // Make sure that this field's instance is marked as deleted when it is
     // specifically loaded.
-    $instance = field_read_instance('test_entity', $this->instance_definition['field_name'], $this->instance_definition['bundle'], array('include_deleted' => TRUE));
+    $instance = field_read_instance('entity_test', $this->instance_definition['field_name'], $this->instance_definition['bundle'], array('include_deleted' => TRUE));
     $this->assertTrue(!empty($instance['deleted']), 'An instance for a deleted field is marked for deletion.');
 
     // Try to load the field normally and make sure it does not show up.
@@ -316,13 +316,13 @@ function testDeleteField() {
     $this->assertTrue(empty($field), 'A deleted field is not loaded by default.');
 
     // Try to load the instance normally and make sure it does not show up.
-    $instance = field_read_instance('test_entity', $this->instance_definition['field_name'], $this->instance_definition['bundle']);
+    $instance = field_read_instance('entity_test', $this->instance_definition['field_name'], $this->instance_definition['bundle']);
     $this->assertTrue(empty($instance), 'An instance for a deleted field is not loaded by default.');
 
     // Make sure the other field (and its field instance) are not deleted.
     $another_field = field_read_field($this->another_field['field_name']);
     $this->assertTrue(!empty($another_field) && empty($another_field['deleted']), 'A non-deleted field is not marked for deletion.');
-    $another_instance = field_read_instance('test_entity', $this->another_instance_definition['field_name'], $this->another_instance_definition['bundle']);
+    $another_instance = field_read_instance('entity_test', $this->another_instance_definition['field_name'], $this->another_instance_definition['bundle']);
     $this->assertTrue(!empty($another_instance) && empty($another_instance['deleted']), 'An instance of a non-deleted field is not marked for deletion.');
 
     // Try to create a new field the same name as a deleted field and
@@ -331,23 +331,26 @@ function testDeleteField() {
     field_create_instance($this->instance_definition);
     $field = field_read_field($this->field['field_name']);
     $this->assertTrue(!empty($field) && empty($field['deleted']), 'A new field with a previously used name is created.');
-    $instance = field_read_instance('test_entity', $this->instance_definition['field_name'], $this->instance_definition['bundle']);
+    $instance = field_read_instance('entity_test', $this->instance_definition['field_name'], $this->instance_definition['bundle']);
     $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 = field_test_create_entity(0, 0, $instance['bundle']);
+    $entity = entity_create('entity_test', array('id' => 0, 'revision_id' => 0));
     $langcode = LANGUAGE_NOT_SPECIFIED;
     $values[0]['value'] = mt_rand(1, 127);
-    $entity->{$field['field_name']}[$langcode] = $values;
-    $entity_type = 'test_entity';
-    field_attach_insert($entity);
+    $entity->{$field['field_name']}->value = $values[0]['value'];
+    field_attach_insert($entity->getBCEntity());
 
     // Verify the field is present on load
-    $entity = field_test_create_entity(0, 0, $this->instance_definition['bundle']);
-    field_attach_load($entity_type, array(0 => $entity));
-    $this->assertIdentical(count($entity->{$field['field_name']}[$langcode]), count($values), "Data in previously deleted field saves and loads correctly");
+    $entity = entity_create('entity_test', array('id' => 0, 'revision_id' => 0));
+    field_attach_load('entity_test', array(0 => $entity->getBCEntity()));
+    debug($entity->getPropertyValues());
+    debug($field);
+    debug($values);
+    debug(count($entity->{$field['field_name']}));
+    $this->assertIdentical(count($entity->{$field['field_name']}), count($values), "Data in previously deleted field saves and loads correctly");
     foreach ($values as $delta => $value) {
-      $this->assertEqual($entity->{$field['field_name']}[$langcode][$delta]['value'], $values[$delta]['value'], "Data in previously deleted field saves and loads correctly");
+      $this->assertEqual($entity->{$field['field_name']}[$delta]->value, $values[$delta]['value'], "Data in previously deleted field saves and loads correctly");
     }
   }
 
@@ -392,28 +395,28 @@ function testUpdateField() {
     $field_definition = field_create_field($field_definition);
     $instance = array(
       'field_name' => 'field_update',
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
     );
     $instance = field_create_instance($instance);
 
     do {
       // We need a unique ID for our entity. $cardinality will do.
       $id = $cardinality;
-      $entity = field_test_create_entity($id, $id, $instance['bundle']);
+      $entity = entity_create('entity_test', array('id' => $id, 'revision_id' => $id));
       // Fill in the entity with more values than $cardinality.
       for ($i = 0; $i < 20; $i++) {
-        $entity->field_update[LANGUAGE_NOT_SPECIFIED][$i]['value'] = $i;
+        $entity->field_update[$i]->value = $i;
       }
       // Save the entity.
-      field_attach_insert($entity);
+      field_attach_insert($entity->getBCEntity());
       // Load back and assert there are $cardinality number of values.
-      $entity = field_test_create_entity($id, $id, $instance['bundle']);
-      field_attach_load('test_entity', array($id => $entity));
-      $this->assertEqual(count($entity->field_update[LANGUAGE_NOT_SPECIFIED]), $field_definition['cardinality'], 'Cardinality is kept');
+      $entity = entity_create('entity_test', array('id' => $id, 'revision_id' => $id));
+      field_attach_load('entity_test', array($id => $entity->getBCEntity()));
+      $this->assertEqual(count($entity->field_update), $field_definition['cardinality'], 'Cardinality is kept');
       // Now check the values themselves.
       for ($delta = 0; $delta < $cardinality; $delta++) {
-        $this->assertEqual($entity->field_update[LANGUAGE_NOT_SPECIFIED][$delta]['value'], $delta, 'Value is kept');
+        $this->assertEqual($entity->field_update[$delta]->value, $delta, 'Value is kept');
       }
       // Increase $cardinality and set the field cardinality to the new value.
       $field_definition['cardinality'] = ++$cardinality;
diff --git a/core/modules/field/lib/Drupal/field/Tests/DisplayApiTest.php b/core/modules/field/lib/Drupal/field/Tests/DisplayApiTest.php
index 6f7d159..f3237ea 100644
--- a/core/modules/field/lib/Drupal/field/Tests/DisplayApiTest.php
+++ b/core/modules/field/lib/Drupal/field/Tests/DisplayApiTest.php
@@ -9,6 +9,13 @@
 
 class DisplayApiTest extends FieldUnitTestBase {
 
+  /**
+   * The test entity.
+   *
+   * @var \Drupal\Core\Entity\EntityInterface
+   */
+  protected $entity;
+
   public static function getInfo() {
     return array(
       'name' => 'Field Display API tests',
@@ -32,8 +39,8 @@ function setUp() {
     );
     $this->instance = array(
       'field_name' => $this->field_name,
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
       'label' => $this->label,
     );
 
@@ -65,10 +72,9 @@ function setUp() {
 
     // Create an entity with values.
     $this->values = $this->_generateTestFieldValues($this->cardinality);
-    $this->entity = field_test_create_entity();
-    $this->is_new = TRUE;
-    $this->entity->{$this->field_name}[LANGUAGE_NOT_SPECIFIED] = $this->values;
-    field_test_entity_save($this->entity);
+    $this->entity = entity_create('entity_test', array());
+    $this->entity->{$this->field_name}->setValue($this->values);
+    $this->entity->save();
   }
 
   /**
@@ -76,7 +82,7 @@ function setUp() {
    */
   function testFieldViewField() {
     // No display settings: check that default display settings are used.
-    $output = field_view_field($this->entity, $this->field_name);
+    $output = field_view_field($this->entity->getBCEntity(), $this->field_name);
     $this->content = drupal_render($output);
     $settings = field_info_formatter_settings('field_test_default');
     $setting = $settings['test_formatter_setting'];
@@ -94,7 +100,7 @@ function testFieldViewField() {
         'alter' => TRUE,
       ),
     );
-    $output = field_view_field($this->entity, $this->field_name, $display);
+    $output = field_view_field($this->entity->getBCEntity(), $this->field_name, $display);
     $this->content = drupal_render($output);
     $setting = $display['settings']['test_formatter_setting_multiple'];
     $this->assertNoText($this->label, 'Label was not displayed.');
@@ -113,7 +119,7 @@ function testFieldViewField() {
         'test_formatter_setting_additional' => $this->randomName(),
       ),
     );
-    $output = field_view_field($this->entity, $this->field_name, $display);
+    $output = field_view_field($this->entity->getBCEntity(), $this->field_name, $display);
     $view = drupal_render($output);
     $this->content = $view;
     $setting = $display['settings']['test_formatter_setting_additional'];
@@ -125,7 +131,7 @@ function testFieldViewField() {
 
     // View mode: check that display settings specified in the display object
     // are used.
-    $output = field_view_field($this->entity, $this->field_name, 'teaser');
+    $output = field_view_field($this->entity->getBCEntity(), $this->field_name, 'teaser');
     $this->content = drupal_render($output);
     $setting = $this->display_options['teaser']['settings']['test_formatter_setting'];
     $this->assertText($this->label, 'Label was displayed.');
@@ -135,7 +141,7 @@ function testFieldViewField() {
 
     // Unknown view mode: check that display settings for 'default' view mode
     // are used.
-    $output = field_view_field($this->entity, $this->field_name, 'unknown_view_mode');
+    $output = field_view_field($this->entity->getBCEntity(), $this->field_name, 'unknown_view_mode');
     $this->content = drupal_render($output);
     $setting = $this->display_options['default']['settings']['test_formatter_setting'];
     $this->assertText($this->label, 'Label was displayed.');
@@ -152,8 +158,8 @@ function testFieldViewValue() {
     $settings = field_info_formatter_settings('field_test_default');
     $setting = $settings['test_formatter_setting'];
     foreach ($this->values as $delta => $value) {
-      $item = $this->entity->{$this->field_name}[LANGUAGE_NOT_SPECIFIED][$delta];
-      $output = field_view_value($this->entity, $this->field_name, $item);
+      $item = $this->entity->{$this->field_name}[$delta]->getValue();
+      $output = field_view_value($this->entity->getBCEntity(), $this->field_name, $item);
       $this->content = drupal_render($output);
       $this->assertText($setting . '|' . $value['value'], format_string('Value @delta was displayed with expected setting.', array('@delta' => $delta)));
     }
@@ -168,8 +174,8 @@ function testFieldViewValue() {
     $setting = $display['settings']['test_formatter_setting_multiple'];
     $array = array();
     foreach ($this->values as $delta => $value) {
-      $item = $this->entity->{$this->field_name}[LANGUAGE_NOT_SPECIFIED][$delta];
-      $output = field_view_value($this->entity, $this->field_name, $item, $display);
+      $item = $this->entity->{$this->field_name}[$delta]->getValue();
+      $output = field_view_value($this->entity->getBCEntity(), $this->field_name, $item, $display);
       $this->content = drupal_render($output);
       $this->assertText($setting . '|0:' . $value['value'], format_string('Value @delta was displayed with expected setting.', array('@delta' => $delta)));
     }
@@ -184,8 +190,8 @@ function testFieldViewValue() {
     $setting = $display['settings']['test_formatter_setting_additional'];
     $array = array();
     foreach ($this->values as $delta => $value) {
-      $item = $this->entity->{$this->field_name}[LANGUAGE_NOT_SPECIFIED][$delta];
-      $output = field_view_value($this->entity, $this->field_name, $item, $display);
+      $item = $this->entity->{$this->field_name}[$delta]->getValue();
+      $output = field_view_value($this->entity->getBCEntity(), $this->field_name, $item, $display);
       $this->content = drupal_render($output);
       $this->assertText($setting . '|' . $value['value'] . '|' . ($value['value'] + 1), format_string('Value @delta was displayed with expected setting.', array('@delta' => $delta)));
     }
@@ -194,8 +200,8 @@ function testFieldViewValue() {
     // used.
     $setting = $this->display_options['teaser']['settings']['test_formatter_setting'];
     foreach ($this->values as $delta => $value) {
-      $item = $this->entity->{$this->field_name}[LANGUAGE_NOT_SPECIFIED][$delta];
-      $output = field_view_value($this->entity, $this->field_name, $item, 'teaser');
+      $item = $this->entity->{$this->field_name}[$delta]->getValue();
+      $output = field_view_value($this->entity->getBCEntity(), $this->field_name, $item, 'teaser');
       $this->content = drupal_render($output);
       $this->assertText($setting . '|' . $value['value'], format_string('Value @delta was displayed with expected setting.', array('@delta' => $delta)));
     }
@@ -204,8 +210,8 @@ function testFieldViewValue() {
     // are used.
     $setting = $this->display_options['default']['settings']['test_formatter_setting'];
     foreach ($this->values as $delta => $value) {
-      $item = $this->entity->{$this->field_name}[LANGUAGE_NOT_SPECIFIED][$delta];
-      $output = field_view_value($this->entity, $this->field_name, $item, 'unknown_view_mode');
+      $item = $this->entity->{$this->field_name}[$delta]->getValue();
+      $output = field_view_value($this->entity->getBCEntity(), $this->field_name, $item, 'unknown_view_mode');
       $this->content = drupal_render($output);
       $this->assertText($setting . '|' . $value['value'], format_string('Value @delta was displayed with expected setting.', array('@delta' => $delta)));
     }
diff --git a/core/modules/field/lib/Drupal/field/Tests/FieldAttachOtherTest.php b/core/modules/field/lib/Drupal/field/Tests/FieldAttachOtherTest.php
index 1ec87cf..597fa20 100644
--- a/core/modules/field/lib/Drupal/field/Tests/FieldAttachOtherTest.php
+++ b/core/modules/field/lib/Drupal/field/Tests/FieldAttachOtherTest.php
@@ -32,16 +32,16 @@ public function setUp() {
   function testFieldAttachView() {
     $this->createFieldWithInstance('_2');
 
-    $entity_type = 'test_entity';
-    $entity_init = field_test_create_entity();
+    $entity_type = 'entity_test';
+    $entity_init = entity_create($entity_type, array());
     $langcode = LANGUAGE_NOT_SPECIFIED;
     $options = array('field_name' => $this->field_name_2);
 
     // Populate values to be displayed.
     $values = $this->_generateTestFieldValues($this->field['cardinality']);
-    $entity_init->{$this->field_name}[$langcode] = $values;
+    $entity_init->{$this->field_name}->setValue($values);
     $values_2 = $this->_generateTestFieldValues($this->field_2['cardinality']);
-    $entity_init->{$this->field_name_2}[$langcode] = $values_2;
+    $entity_init->{$this->field_name_2}->setValue($values_2);
 
     // Simple formatter, label displayed.
     $entity = clone($entity_init);
@@ -69,9 +69,9 @@ function testFieldAttachView() {
     $display->setComponent($this->field_2['field_name'], $display_options_2);
 
     // View all fields.
-    field_attach_prepare_view($entity_type, array($entity->ftid => $entity), $displays);
-    $entity->content = field_attach_view($entity, $display);
-    $output = drupal_render($entity->content);
+    field_attach_prepare_view($entity_type, array($entity->ftid => $entity->getBCEntity()), $displays);
+    $content = field_attach_view($entity, $display);
+    $output = drupal_render($content);
     $this->content = $output;
     $this->assertRaw($this->instance['label'], "First field's label is displayed.");
     foreach ($values as $delta => $value) {
@@ -180,22 +180,22 @@ function testFieldAttachView() {
    * Tests the 'multiple entity' behavior of field_attach_prepare_view().
    */
   function testFieldAttachPrepareViewMultiple() {
-    $entity_type = 'test_entity';
+    $entity_type = 'entity_test';
     $langcode = LANGUAGE_NOT_SPECIFIED;
 
     // Set the instance to be hidden.
-    $display = entity_get_display('test_entity', 'test_bundle', 'full')
+    $display = entity_get_display('entity_test', 'entity_test', 'full')
       ->removeComponent($this->field['field_name']);
 
     // Set up a second instance on another bundle, with a formatter that uses
     // hook_field_formatter_prepare_view().
-    field_test_create_bundle('test_bundle_2');
+    entity_test_create_bundle('test_bundle_2');
     $formatter_setting = $this->randomName();
     $this->instance2 = $this->instance;
     $this->instance2['bundle'] = 'test_bundle_2';
     field_create_instance($this->instance2);
 
-    $display_2 = entity_get_display('test_entity', 'test_bundle_2', 'full')
+    $display_2 = entity_get_display('entity_test', 'test_bundle_2', 'full')
       ->setComponent($this->field['field_name'], array(
         'type' => 'field_test_with_prepare_view',
         'settings' => array(
@@ -203,21 +203,21 @@ function testFieldAttachPrepareViewMultiple() {
         ),
       ));
 
-    $displays = array('test_bundle' => $display, 'test_bundle_2' => $display_2);
+    $displays = array('entity_test' => $display, 'test_bundle_2' => $display_2);
 
     // Create one entity in each bundle.
-    $entity1_init = field_test_create_entity(1, 1, 'test_bundle');
+    $entity1_init = entity_create('entity_test', array('id' => 1, 'type' => 'entity_test'));
     $values1 = $this->_generateTestFieldValues($this->field['cardinality']);
-    $entity1_init->{$this->field_name}[$langcode] = $values1;
+    $entity1_init->{$this->field_name}->setValue($values1);
 
-    $entity2_init = field_test_create_entity(2, 2, 'test_bundle_2');
+    $entity2_init = entity_create('entity_test', array('id' => 2, 'type' => 'test_bundle_2'));
     $values2 = $this->_generateTestFieldValues($this->field['cardinality']);
-    $entity2_init->{$this->field_name}[$langcode] = $values2;
+    $entity2_init->{$this->field_name}->setValue($values2);
 
     // Run prepare_view, and check that the entities come out as expected.
     $entity1 = clone($entity1_init);
     $entity2 = clone($entity2_init);
-    $entities = array($entity1->ftid => $entity1, $entity2->ftid => $entity2);
+    $entities = array($entity1->id() => $entity1->getBCEntity(), $entity2->id() => $entity2->getBCEntity());
     field_attach_prepare_view($entity_type, $entities, $displays);
     $this->assertFalse(isset($entity1->{$this->field_name}[$langcode][0]['additional_formatter_value']), 'Entity 1 did not run through the prepare_view hook.');
     $this->assertTrue(isset($entity2->{$this->field_name}[$langcode][0]['additional_formatter_value']), 'Entity 2 ran through the prepare_view hook.');
@@ -241,7 +241,7 @@ function testFieldAttachCache() {
     $values = $this->_generateTestFieldValues($this->field['cardinality']);
 
     // Non-cacheable entity type.
-    $entity_type = 'test_entity';
+    $entity_type = 'entity_test';
     $cid = "field:$entity_type:{$entity_init->ftid}";
 
     // Check that no initial cache entry is present.
@@ -338,9 +338,8 @@ function testFieldAttachCache() {
   function testFieldAttachValidate() {
     $this->createFieldWithInstance('_2');
 
-    $entity_type = 'test_entity';
-    $entity = field_test_create_entity(0, 0, $this->instance['bundle']);
-    $langcode = LANGUAGE_NOT_SPECIFIED;
+    $entity_type = 'entity_test';
+    $entity = entity_create($entity_type, array('type' => $this->instance['bundle']));
 
     // Set up all but one values of the first field to generate errors.
     $values = array();
@@ -349,21 +348,22 @@ function testFieldAttachValidate() {
     }
     // Arrange for item 1 not to generate an error.
     $values[1]['value'] = 1;
-    $entity->{$this->field_name}[$langcode] = $values;
+    $entity->{$this->field_name}->value = 1;
 
     // Set up all values of the second field to generate errors.
     $values_2 = array();
     for ($delta = 0; $delta < $this->field_2['cardinality']; $delta++) {
       $values_2[$delta]['value'] = -1;
     }
-    $entity->{$this->field_name_2}[$langcode] = $values_2;
+    $entity->{$this->field_name_2}->setValue($values_2);
 
     // Validate all fields.
     try {
-      field_attach_validate($entity);
+      field_attach_validate($entity->getBCEntity());
     }
     catch (FieldValidationException $e) {
       $errors = $e->errors;
+      debug($errors);
     }
 
     foreach ($values as $delta => $value) {
@@ -430,7 +430,7 @@ function testFieldAttachValidate() {
   function testFieldAttachForm() {
     $this->createFieldWithInstance('_2');
 
-    $entity_type = 'test_entity';
+    $entity_type = 'entity_test';
     $entity = field_test_create_entity(0, 0, $this->instance['bundle']);
     $langcode = LANGUAGE_NOT_SPECIFIED;
 
@@ -470,7 +470,7 @@ function testFieldAttachForm() {
   function testFieldAttachExtractFormValues() {
     $this->createFieldWithInstance('_2');
 
-    $entity_type = 'test_entity';
+    $entity_type = 'entity_test';
     $entity_init = field_test_create_entity(0, 0, $this->instance['bundle']);
     $langcode = LANGUAGE_NOT_SPECIFIED;
 
diff --git a/core/modules/field/lib/Drupal/field/Tests/FieldAttachStorageTest.php b/core/modules/field/lib/Drupal/field/Tests/FieldAttachStorageTest.php
index 6c7df44..fb10574 100644
--- a/core/modules/field/lib/Drupal/field/Tests/FieldAttachStorageTest.php
+++ b/core/modules/field/lib/Drupal/field/Tests/FieldAttachStorageTest.php
@@ -40,52 +40,52 @@ function testFieldAttachSaveLoad() {
     field_update_instance($this->instance);
     $langcode = LANGUAGE_NOT_SPECIFIED;
 
-    $entity_type = 'test_entity';
+    $entity_type = 'entity_test';
     $values = array();
 
     // TODO : test empty values filtering and "compression" (store consecutive deltas).
 
     // Preparation: create three revisions and store them in $revision array.
     for ($revision_id = 0; $revision_id < 3; $revision_id++) {
-      $revision[$revision_id] = field_test_create_entity(0, $revision_id, $this->instance['bundle']);
+      $revision[$revision_id] = entity_create($entity_type, array('id' => 0, 'revision_id' => $revision_id));
       // Note: we try to insert one extra value.
       $values[$revision_id] = $this->_generateTestFieldValues($this->field['cardinality'] + 1);
       $current_revision = $revision_id;
       // If this is the first revision do an insert.
       if (!$revision_id) {
-        $revision[$revision_id]->{$this->field_name}[$langcode] = $values[$revision_id];
-        field_attach_insert($revision[$revision_id]);
+        $revision[$revision_id]->{$this->field_name}->setValue($values[$revision_id]);
+        field_attach_insert($revision[$revision_id]->getBCEntity());
       }
       else {
         // Otherwise do an update.
-        $revision[$revision_id]->{$this->field_name}[$langcode] = $values[$revision_id];
-        field_attach_update($revision[$revision_id]);
+        $revision[$revision_id]->{$this->field_name}->setValue($values[$revision_id]);
+        field_attach_update($revision[$revision_id]->getBCEntity());
       }
     }
 
     // Confirm current revision loads the correct data.
-    $entity = field_test_create_entity(0, 0, $this->instance['bundle']);
-    field_attach_load($entity_type, array(0 => $entity));
+    $entity = entity_create('entity_test', array('id' => 0, 'revision_id' => 0));
+    field_attach_load($entity_type, array(0 => $entity->getBCEntity()));
     // Number of values per field loaded equals the field cardinality.
-    $this->assertEqual(count($entity->{$this->field_name}[$langcode]), $this->field['cardinality'], 'Current revision: expected number of values');
+    $this->assertEqual(count($entity->{$this->field_name}), $this->field['cardinality'], 'Current revision: expected number of values');
     for ($delta = 0; $delta < $this->field['cardinality']; $delta++) {
       // The field value loaded matches the one inserted or updated.
-      $this->assertEqual($entity->{$this->field_name}[$langcode][$delta]['value'] , $values[$current_revision][$delta]['value'], format_string('Current revision: expected value %delta was found.', array('%delta' => $delta)));
+      $this->assertEqual($entity->{$this->field_name}[$delta]->value , $values[$current_revision][$delta]['value'], format_string('Current revision: expected value %delta was found.', array('%delta' => $delta)));
       // The value added in hook_field_load() is found.
-      $this->assertEqual($entity->{$this->field_name}[$langcode][$delta]['additional_key'], 'additional_value', format_string('Current revision: extra information for value %delta was found', array('%delta' => $delta)));
+      $this->assertEqual($entity->{$this->field_name}[$delta]->additional_key, 'additional_value', format_string('Current revision: extra information for value %delta was found', array('%delta' => $delta)));
     }
 
     // Confirm each revision loads the correct data.
     foreach (array_keys($revision) as $revision_id) {
-      $entity = field_test_create_entity(0, $revision_id, $this->instance['bundle']);
-      field_attach_load_revision($entity_type, array(0 => $entity));
+      $entity = entity_create('entity_test', array('id' => 0, 'revision_id' => $revision_id));
+      field_attach_load_revision($entity_type, array(0 => $entity->getBCEntity()));
       // Number of values per field loaded equals the field cardinality.
-      $this->assertEqual(count($entity->{$this->field_name}[$langcode]), $this->field['cardinality'], format_string('Revision %revision_id: expected number of values.', array('%revision_id' => $revision_id)));
+      $this->assertEqual(count($entity->{$this->field_name}), $this->field['cardinality'], format_string('Revision %revision_id: expected number of values.', array('%revision_id' => $revision_id)));
       for ($delta = 0; $delta < $this->field['cardinality']; $delta++) {
         // The field value loaded matches the one inserted or updated.
-        $this->assertEqual($entity->{$this->field_name}[$langcode][$delta]['value'], $values[$revision_id][$delta]['value'], format_string('Revision %revision_id: expected value %delta was found.', array('%revision_id' => $revision_id, '%delta' => $delta)));
+        $this->assertEqual($entity->{$this->field_name}[$delta]->value, $values[$revision_id][$delta]['value'], format_string('Revision %revision_id: expected value %delta was found.', array('%revision_id' => $revision_id, '%delta' => $delta)));
         // The value added in hook_field_load() is found.
-        $this->assertEqual($entity->{$this->field_name}[$langcode][$delta]['additional_key'], 'additional_value', format_string('Revision %revision_id: extra information for value %delta was found', array('%revision_id' => $revision_id, '%delta' => $delta)));
+        $this->assertEqual($entity->{$this->field_name}[$delta]->additional_key, 'additional_value', format_string('Revision %revision_id: extra information for value %delta was found', array('%revision_id' => $revision_id, '%delta' => $delta)));
       }
     }
   }
@@ -94,7 +94,7 @@ function testFieldAttachSaveLoad() {
    * Test the 'multiple' load feature.
    */
   function testFieldAttachLoadMultiple() {
-    $entity_type = 'test_entity';
+    $entity_type = 'entity_test';
     $langcode = LANGUAGE_NOT_SPECIFIED;
 
     // Define 2 bundles.
@@ -102,8 +102,8 @@ function testFieldAttachLoadMultiple() {
       1 => 'test_bundle_1',
       2 => 'test_bundle_2',
     );
-    field_test_create_bundle($bundles[1]);
-    field_test_create_bundle($bundles[2]);
+    entity_test_create_bundle($bundles[1]);
+    entity_test_create_bundle($bundles[2]);
     // Define 3 fields:
     // - field_1 is in bundle_1 and bundle_2,
     // - field_2 is in bundle_1,
@@ -121,7 +121,7 @@ function testFieldAttachLoadMultiple() {
       foreach ($field_bundles_map[$i] as $bundle) {
         $instance = array(
           'field_name' => $field_names[$i],
-          'entity_type' => 'test_entity',
+          'entity_type' => 'entity_test',
           'bundle' => $bundles[$bundle],
           'settings' => array(
             // Configure the instance so that we test hook_field_load()
@@ -135,14 +135,14 @@ function testFieldAttachLoadMultiple() {
 
     // Create one test entity per bundle, with random values.
     foreach ($bundles as $index => $bundle) {
-      $entities[$index] = field_test_create_entity($index, $index, $bundle);
+      $entities[$index] = entity_create('entity_test', array('id' => $index, 'revision_id' => $index));
       $entity = clone($entities[$index]);
-      $instances = field_info_instances('test_entity', $bundle);
+      $instances = field_info_instances('entity_test', $bundle);
       foreach ($instances as $field_name => $instance) {
         $values[$index][$field_name] = mt_rand(1, 127);
-        $entity->$field_name = array($langcode => array(array('value' => $values[$index][$field_name])));
+        $entity->$field_name->setValue(array('value' => $values[$index][$field_name]));
       }
-      field_attach_insert($entity);
+      field_attach_insert($entity->getBCEntity());
     }
 
     // Check that a single load correctly loads field values for both entities.
@@ -151,9 +151,9 @@ function testFieldAttachLoadMultiple() {
       $instances = field_info_instances($entity_type, $bundles[$index]);
       foreach ($instances as $field_name => $instance) {
         // The field value loaded matches the one inserted.
-        $this->assertEqual($entity->{$field_name}[$langcode][0]['value'], $values[$index][$field_name], format_string('Entity %index: expected value was found.', array('%index' => $index)));
+        $this->assertEqual($entity->{$field_name}->value, $values[$index][$field_name], format_string('Entity %index: expected value was found.', array('%index' => $index)));
         // The value added in hook_field_load() is found.
-        $this->assertEqual($entity->{$field_name}[$langcode][0]['additional_key'], 'additional_value', format_string('Entity %index: extra information was found', array('%index' => $index)));
+        $this->assertEqual($entity->{$field_name}->additional_key, 'additional_value', format_string('Entity %index: extra information was found', array('%index' => $index)));
       }
     }
 
@@ -170,7 +170,7 @@ function testFieldAttachLoadMultiple() {
    * Test saving and loading fields using different storage backends.
    */
   function testFieldAttachSaveLoadDifferentStorage() {
-    $entity_type = 'test_entity';
+    $entity_type = 'entity_test';
     $langcode = LANGUAGE_NOT_SPECIFIED;
 
     // Create two fields using different storage backends, and their instances.
@@ -192,8 +192,8 @@ function testFieldAttachSaveLoadDifferentStorage() {
       field_create_field($field);
       $instance = array(
         'field_name' => $field['field_name'],
-        'entity_type' => 'test_entity',
-        'bundle' => 'test_bundle',
+        'entity_type' => 'entity_test',
+        'bundle' => 'entity_test',
       );
       field_create_instance($instance);
     }
@@ -233,8 +233,8 @@ function testFieldStorageDetailsAlter() {
     $field = field_create_field($field);
     $instance = array(
       'field_name' => $field_name,
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
     );
     field_create_instance($instance);
 
@@ -263,7 +263,7 @@ function testFieldStorageDetailsAlter() {
    * Tests insert and update with missing or NULL fields.
    */
   function testFieldAttachSaveMissingData() {
-    $entity_type = 'test_entity';
+    $entity_type = 'entity_test';
     $entity_init = field_test_create_entity();
     $langcode = LANGUAGE_NOT_SPECIFIED;
 
@@ -346,7 +346,7 @@ function testFieldAttachSaveMissingDataDefaultValue() {
     field_update_instance($this->instance);
 
     // Verify that fields are populated with default values.
-    $entity_type = 'test_entity';
+    $entity_type = 'entity_test';
     $entity_init = field_test_create_entity();
     $langcode = LANGUAGE_NOT_SPECIFIED;
     $default = field_test_default_value($entity_init, $this->field, $this->instance);
@@ -374,7 +374,7 @@ function testFieldAttachSaveMissingDataDefaultValue() {
 
     // Verify that prepopulated field values are not overwritten by defaults.
     $value = array(array('value' => $default[0]['value'] - mt_rand(1, 127)));
-    $entity = entity_create('test_entity', array('fttype' => $entity_init->bundle(), $this->field_name => array($langcode => $value)));
+    $entity = entity_create('entity_test', array('fttype' => $entity_init->bundle(), $this->field_name => array($langcode => $value)));
     $this->assertEqual($entity->{$this->field_name}[$langcode], $value, 'Prepopulated field value correctly maintained.');
   }
 
@@ -382,7 +382,7 @@ function testFieldAttachSaveMissingDataDefaultValue() {
    * Test field_attach_delete().
    */
   function testFieldAttachDelete() {
-    $entity_type = 'test_entity';
+    $entity_type = 'entity_test';
     $langcode = LANGUAGE_NOT_SPECIFIED;
     $rev[0] = field_test_create_entity(0, 0, $this->instance['bundle']);
 
@@ -439,7 +439,7 @@ function testFieldAttachDelete() {
   function testFieldAttachCreateRenameBundle() {
     // Create a new bundle.
     $new_bundle = 'test_bundle_' . drupal_strtolower($this->randomName());
-    field_test_create_bundle($new_bundle);
+    entity_test_create_bundle($new_bundle);
 
     // Add an instance to that bundle.
     $this->instance['bundle'] = $new_bundle;
@@ -450,7 +450,7 @@ function testFieldAttachCreateRenameBundle() {
     $langcode = LANGUAGE_NOT_SPECIFIED;
     $values = $this->_generateTestFieldValues($this->field['cardinality']);
     $entity->{$this->field_name}[$langcode] = $values;
-    $entity_type = 'test_entity';
+    $entity_type = 'entity_test';
     field_attach_insert($entity);
 
     // Verify the field data is present on load.
@@ -478,7 +478,7 @@ function testFieldAttachCreateRenameBundle() {
   function testFieldAttachDeleteBundle() {
     // Create a new bundle.
     $new_bundle = 'test_bundle_' . drupal_strtolower($this->randomName());
-    field_test_create_bundle($new_bundle);
+    entity_test_create_bundle($new_bundle);
 
     // Add an instance to that bundle.
     $this->instance['bundle'] = $new_bundle;
@@ -490,7 +490,7 @@ function testFieldAttachDeleteBundle() {
     field_create_field($field);
     $instance = array(
       'field_name' => $field_name,
-      'entity_type' => 'test_entity',
+      'entity_type' => 'entity_test',
       'bundle' => $this->instance['bundle'],
       'label' => $this->randomName() . '_label',
       'description' => $this->randomName() . '_description',
@@ -512,7 +512,7 @@ function testFieldAttachDeleteBundle() {
 
     // Verify the fields are present on load
     $entity = field_test_create_entity(0, 0, $this->instance['bundle']);
-    field_attach_load('test_entity', array(0 => $entity));
+    field_attach_load('entity_test', array(0 => $entity));
     $this->assertEqual(count($entity->{$this->field_name}[$langcode]), 4, 'First field got loaded');
     $this->assertEqual(count($entity->{$field_name}[$langcode]), 1, 'Second field got loaded');
 
@@ -521,12 +521,12 @@ function testFieldAttachDeleteBundle() {
 
     // Verify no data gets loaded
     $entity = field_test_create_entity(0, 0, $this->instance['bundle']);
-    field_attach_load('test_entity', array(0 => $entity));
+    field_attach_load('entity_test', array(0 => $entity));
     $this->assertFalse(isset($entity->{$this->field_name}[$langcode]), 'No data for first field');
     $this->assertFalse(isset($entity->{$field_name}[$langcode]), 'No data for second field');
 
     // Verify that the instances are gone
-    $this->assertFalse(field_read_instance('test_entity', $this->field_name, $this->instance['bundle']), "First field is deleted");
-    $this->assertFalse(field_read_instance('test_entity', $field_name, $instance['bundle']), "Second field is deleted");
+    $this->assertFalse(field_read_instance('entity_test', $this->field_name, $this->instance['bundle']), "First field is deleted");
+    $this->assertFalse(field_read_instance('entity_test', $field_name, $instance['bundle']), "Second field is deleted");
   }
 }
diff --git a/core/modules/field/lib/Drupal/field/Tests/FieldInfoTest.php b/core/modules/field/lib/Drupal/field/Tests/FieldInfoTest.php
index ea6f26e..1c9b708 100644
--- a/core/modules/field/lib/Drupal/field/Tests/FieldInfoTest.php
+++ b/core/modules/field/lib/Drupal/field/Tests/FieldInfoTest.php
@@ -46,11 +46,11 @@ function testFieldInfo() {
     }
 
     // Verify that no unexpected instances exist.
-    $instances = field_info_instances('test_entity');
+    $instances = field_info_instances('entity_test');
     $expected = array();
-    $this->assertIdentical($instances, $expected, format_string("field_info_instances('test_entity') returns %expected.", array('%expected' => var_export($expected, TRUE))));
-    $instances = field_info_instances('test_entity', 'test_bundle');
-    $this->assertIdentical($instances, array(), "field_info_instances('test_entity', 'test_bundle') returns an empty array.");
+    $this->assertIdentical($instances, $expected, format_string("field_info_instances('entity_test') returns %expected.", array('%expected' => var_export($expected, TRUE))));
+    $instances = field_info_instances('entity_test', 'entity_test');
+    $this->assertIdentical($instances, array(), "field_info_instances('entity_test', 'entity_test') returns an empty array.");
 
     // Create a field, verify it shows up.
     $core_fields = field_info_fields();
@@ -74,8 +74,8 @@ function testFieldInfo() {
     // Create an instance, verify that it shows up
     $instance = array(
       'field_name' => $field['field_name'],
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
       'label' => $this->randomName(),
       'description' => $this->randomName(),
       'weight' => mt_rand(0, 127),
@@ -86,20 +86,20 @@ function testFieldInfo() {
           'test_setting' => 999)));
     field_create_instance($instance);
 
-    $info = entity_get_info('test_entity');
-    $instances = field_info_instances('test_entity', $instance['bundle']);
+    $info = entity_get_info('entity_test');
+    $instances = field_info_instances('entity_test', $instance['bundle']);
     $this->assertEqual(count($instances), 1, format_string('One instance shows up in info when attached to a bundle on a @label.', array(
       '@label' => $info['label']
     )));
     $this->assertTrue($instance < $instances[$instance['field_name']], 'Instance appears in info correctly');
 
     // Test a valid entity type but an invalid bundle.
-    $instances = field_info_instances('test_entity', 'invalid_bundle');
-    $this->assertIdentical($instances, array(), "field_info_instances('test_entity', 'invalid_bundle') returns an empty array.");
+    $instances = field_info_instances('entity_test', 'invalid_bundle');
+    $this->assertIdentical($instances, array(), "field_info_instances('entity_test', 'invalid_bundle') returns an empty array.");
 
     // Test invalid entity type and bundle.
     $instances = field_info_instances('invalid_entity', $instance['bundle']);
-    $this->assertIdentical($instances, array(), "field_info_instances('invalid_entity', 'test_bundle') returns an empty array.");
+    $this->assertIdentical($instances, array(), "field_info_instances('invalid_entity', 'entity_test') returns an empty array.");
 
     // Test invalid entity type, no bundle provided.
     $instances = field_info_instances('invalid_entity');
@@ -165,8 +165,8 @@ function testInstancePrepare() {
     field_create_field($field_definition);
     $instance_definition = array(
       'field_name' => $field_definition['field_name'],
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
     );
     field_create_instance($instance_definition);
 
@@ -230,8 +230,8 @@ function testFieldMap() {
     // We will overlook fields created by the 'standard' installation profile.
     $exclude = field_info_field_map();
 
-    // Create a new bundle for 'test_entity' entity type.
-    field_test_create_bundle('test_bundle_2');
+    // Create a new bundle for 'entity_test' entity type.
+    entity_test_create_bundle('test_bundle_2');
 
     // Create a couple fields.
     $fields  = array(
@@ -252,23 +252,23 @@ function testFieldMap() {
     $instances = array(
       array(
         'field_name' => 'field_1',
-        'entity_type' => 'test_entity',
-        'bundle' => 'test_bundle',
+        'entity_type' => 'entity_test',
+        'bundle' => 'entity_test',
       ),
       array(
         'field_name' => 'field_1',
-        'entity_type' => 'test_entity',
+        'entity_type' => 'entity_test',
         'bundle' => 'test_bundle_2',
       ),
       array(
         'field_name' => 'field_2',
-        'entity_type' => 'test_entity',
-        'bundle' => 'test_bundle',
+        'entity_type' => 'entity_test',
+        'bundle' => 'entity_test',
       ),
       array(
         'field_name' => 'field_2',
         'entity_type' => 'test_cacheable_entity',
-        'bundle' => 'test_bundle',
+        'bundle' => 'entity_test',
       ),
     );
     foreach ($instances as $instance) {
@@ -279,14 +279,14 @@ function testFieldMap() {
       'field_1' => array(
         'type' => 'test_field',
         'bundles' => array(
-          'test_entity' => array('test_bundle', 'test_bundle_2'),
+          'entity_test' => array('entity_test', 'test_bundle_2'),
         ),
       ),
       'field_2' => array(
         'type' => 'hidden_test_field',
         'bundles' => array(
-          'test_entity' => array('test_bundle'),
-          'test_cacheable_entity' => array('test_bundle'),
+          'entity_test' => array('entity_test'),
+          'test_cacheable_entity' => array('entity_test'),
         ),
       ),
     );
diff --git a/core/modules/field/lib/Drupal/field/Tests/FieldInstanceCrudTest.php b/core/modules/field/lib/Drupal/field/Tests/FieldInstanceCrudTest.php
index ee30cf1..8fc15f5 100644
--- a/core/modules/field/lib/Drupal/field/Tests/FieldInstanceCrudTest.php
+++ b/core/modules/field/lib/Drupal/field/Tests/FieldInstanceCrudTest.php
@@ -31,8 +31,8 @@ function setUp() {
     field_create_field($this->field);
     $this->instance_definition = array(
       'field_name' => $this->field['field_name'],
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
     );
   }
 
@@ -131,7 +131,7 @@ function testReadFieldInstance() {
     field_create_instance($this->instance_definition);
 
     // Read the instance back.
-    $instance = field_read_instance('test_entity', $this->instance_definition['field_name'], $this->instance_definition['bundle']);
+    $instance = field_read_instance('entity_test', $this->instance_definition['field_name'], $this->instance_definition['bundle']);
     $this->assertTrue($this->instance_definition == $instance, 'The field was properly read.');
   }
 
@@ -142,7 +142,7 @@ function testUpdateFieldInstance() {
     field_create_instance($this->instance_definition);
 
     // Check that basic changes are saved.
-    $instance = field_read_instance('test_entity', $this->instance_definition['field_name'], $this->instance_definition['bundle']);
+    $instance = field_read_instance('entity_test', $this->instance_definition['field_name'], $this->instance_definition['bundle']);
     $instance['required'] = !$instance['required'];
     $instance['label'] = $this->randomName();
     $instance['description'] = $this->randomName();
@@ -151,7 +151,7 @@ function testUpdateFieldInstance() {
     $instance['widget']['weight']++;
     field_update_instance($instance);
 
-    $instance_new = field_read_instance('test_entity', $this->instance_definition['field_name'], $this->instance_definition['bundle']);
+    $instance_new = field_read_instance('entity_test', $this->instance_definition['field_name'], $this->instance_definition['bundle']);
     $this->assertEqual($instance['required'], $instance_new['required'], '"required" change is saved');
     $this->assertEqual($instance['label'], $instance_new['label'], '"label" change is saved');
     $this->assertEqual($instance['description'], $instance_new['description'], '"description" change is saved');
@@ -159,11 +159,11 @@ function testUpdateFieldInstance() {
     $this->assertEqual($instance['widget']['weight'], $instance_new['widget']['weight'], 'Widget weight change is saved');
 
     // Check that changing the widget type updates the default settings.
-    $instance = field_read_instance('test_entity', $this->instance_definition['field_name'], $this->instance_definition['bundle']);
+    $instance = field_read_instance('entity_test', $this->instance_definition['field_name'], $this->instance_definition['bundle']);
     $instance['widget']['type'] = 'test_field_widget_multiple';
     field_update_instance($instance);
 
-    $instance_new = field_read_instance('test_entity', $this->instance_definition['field_name'], $this->instance_definition['bundle']);
+    $instance_new = field_read_instance('entity_test', $this->instance_definition['field_name'], $this->instance_definition['bundle']);
     $this->assertEqual($instance['widget']['type'], $instance_new['widget']['type'] , 'Widget type change is saved.');
     $settings = field_info_widget_settings($instance_new['widget']['type']);
     $this->assertIdentical($settings, array_intersect_key($instance_new['widget']['settings'], $settings) , 'Widget type change updates default settings.');
@@ -187,21 +187,21 @@ function testDeleteFieldInstance() {
     $instance = field_create_instance($this->another_instance_definition);
 
     // Test that the first instance is not deleted, and then delete it.
-    $instance = field_read_instance('test_entity', $this->instance_definition['field_name'], $this->instance_definition['bundle'], array('include_deleted' => TRUE));
+    $instance = field_read_instance('entity_test', $this->instance_definition['field_name'], $this->instance_definition['bundle'], array('include_deleted' => TRUE));
     $this->assertTrue(!empty($instance) && empty($instance['deleted']), 'A new field instance is not marked for deletion.');
     field_delete_instance($instance);
 
     // Make sure the instance is marked as deleted when the instance is
     // specifically loaded.
-    $instance = field_read_instance('test_entity', $this->instance_definition['field_name'], $this->instance_definition['bundle'], array('include_deleted' => TRUE));
+    $instance = field_read_instance('entity_test', $this->instance_definition['field_name'], $this->instance_definition['bundle'], array('include_deleted' => TRUE));
     $this->assertTrue(!empty($instance['deleted']), 'A deleted field instance is marked for deletion.');
 
     // Try to load the instance normally and make sure it does not show up.
-    $instance = field_read_instance('test_entity', $this->instance_definition['field_name'], $this->instance_definition['bundle']);
+    $instance = field_read_instance('entity_test', $this->instance_definition['field_name'], $this->instance_definition['bundle']);
     $this->assertTrue(empty($instance), 'A deleted field instance is not loaded by default.');
 
     // Make sure the other field instance is not deleted.
-    $another_instance = field_read_instance('test_entity', $this->another_instance_definition['field_name'], $this->another_instance_definition['bundle']);
+    $another_instance = field_read_instance('entity_test', $this->another_instance_definition['field_name'], $this->another_instance_definition['bundle']);
     $this->assertTrue(!empty($another_instance) && empty($another_instance['deleted']), 'A non-deleted field instance is not marked for deletion.');
 
     // Make sure the field is deleted when its last instance is deleted.
diff --git a/core/modules/field/lib/Drupal/field/Tests/FieldTestBase.php b/core/modules/field/lib/Drupal/field/Tests/FieldTestBase.php
index a34586e..d473584 100644
--- a/core/modules/field/lib/Drupal/field/Tests/FieldTestBase.php
+++ b/core/modules/field/lib/Drupal/field/Tests/FieldTestBase.php
@@ -61,8 +61,9 @@ function _generateTestFieldValues($cardinality) {
    */
   function assertFieldValues(EntityInterface $entity, $field_name, $langcode, $expected_values, $column = 'value') {
     $e = clone $entity;
-    field_attach_load('test_entity', array($e->ftid => $e));
-    $values = isset($e->{$field_name}[$langcode]) ? $e->{$field_name}[$langcode] : array();
+    $bc_entity = $e->getBCEntity();
+    field_attach_load('entity_test', array($e->id() => $bc_entity));
+    $values = isset($bc_entity->{$field_name}[$langcode]) ? $bc_entity->{$field_name}[$langcode] : array();
     $this->assertEqual(count($values), count($expected_values), 'Expected number of values were saved.');
     foreach ($expected_values as $key => $value) {
       $this->assertEqual($values[$key][$column], $value, format_string('Value @value was saved correctly.', array('@value' => $value)));
diff --git a/core/modules/field/lib/Drupal/field/Tests/FieldUnitTestBase.php b/core/modules/field/lib/Drupal/field/Tests/FieldUnitTestBase.php
index 94b068d..1f69c44 100644
--- a/core/modules/field/lib/Drupal/field/Tests/FieldUnitTestBase.php
+++ b/core/modules/field/lib/Drupal/field/Tests/FieldUnitTestBase.php
@@ -38,7 +38,6 @@ function setUp() {
     $this->installSchema('system', array('sequences', 'variable'));
     $this->installSchema('field', array('field_config', 'field_config_instance'));
     $this->installSchema('entity_test', 'entity_test');
-    $this->installSchema('field_test', array('test_entity', 'test_entity_revision', 'test_entity_bundle'));
 
     // Set default storage backend.
     variable_set('field_storage_default', $this->default_storage);
@@ -63,8 +62,8 @@ function createFieldWithInstance($suffix = '') {
     $this->$field_id = $this->{$field}['id'];
     $this->$instance = array(
       'field_name' => $this->$field_name,
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
       'label' => $this->randomName() . '_label',
       'description' => $this->randomName() . '_description',
       'weight' => mt_rand(0, 127),
diff --git a/core/modules/field/lib/Drupal/field/Tests/FormTest.php b/core/modules/field/lib/Drupal/field/Tests/FormTest.php
index fcda223..ab1a006 100644
--- a/core/modules/field/lib/Drupal/field/Tests/FormTest.php
+++ b/core/modules/field/lib/Drupal/field/Tests/FormTest.php
@@ -14,7 +14,7 @@ class FormTest extends FieldTestBase {
    *
    * @var array
    */
-  public static $modules = array('node', 'field_test', 'options');
+  public static $modules = array('node', 'field_test', 'options', 'entity_test');
 
   public static function getInfo() {
     return array(
@@ -27,7 +27,7 @@ public static function getInfo() {
   function setUp() {
     parent::setUp();
 
-    $web_user = $this->drupalCreateUser(array('access field_test content', 'administer field_test content'));
+    $web_user = $this->drupalCreateUser(array('view test entity', 'administer entity_test content'));
     $this->drupalLogin($web_user);
 
     $this->field_single = array('field_name' => 'field_single', 'type' => 'test_field');
@@ -35,8 +35,8 @@ function setUp() {
     $this->field_unlimited = array('field_name' => 'field_unlimited', 'type' => 'test_field', 'cardinality' => FIELD_CARDINALITY_UNLIMITED);
 
     $this->instance = array(
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
       'label' => $this->randomName() . '_label',
       'description' => '[site:name]_description',
       'weight' => mt_rand(0, 127),
@@ -62,7 +62,7 @@ function testFieldFormSingle() {
     $langcode = LANGUAGE_NOT_SPECIFIED;
 
     // Display creation form.
-    $this->drupalGet('test-entity/add/test_bundle');
+    $this->drupalGet('entity_test/add');
 
     // Create token value expected for description.
     $token_description = check_plain(config('system.site')->get('name')) . '_description';
@@ -75,43 +75,59 @@ function testFieldFormSingle() {
     $this->assertNoText('From hook_field_widget_form_alter(): Default form is true.', 'Not default value form in hook_field_widget_form_alter().');
 
     // Submit with invalid value (field-level validation).
-    $edit = array("{$this->field_name}[$langcode][0][value]" => -1);
+    $edit = array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
+      "{$this->field_name}[$langcode][0][value]" => -1
+    );
     $this->drupalPost(NULL, $edit, t('Save'));
     $this->assertRaw(t('%name does not accept the value -1.', array('%name' => $this->instance['label'])), 'Field validation fails with invalid input.');
     // TODO : check that the correct field is flagged for error.
 
     // Create an entity
     $value = mt_rand(1, 127);
-    $edit = array("{$this->field_name}[$langcode][0][value]" => $value);
+    $edit = array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
+      "{$this->field_name}[$langcode][0][value]" => $value,
+    );
     $this->drupalPost(NULL, $edit, t('Save'));
-    preg_match('|test-entity/manage/(\d+)/edit|', $this->url, $match);
+    preg_match('|entity_test/manage/(\d+)/edit|', $this->url, $match);
     $id = $match[1];
-    $this->assertRaw(t('test_entity @id has been created.', array('@id' => $id)), 'Entity was created');
-    $entity = field_test_entity_test_load($id);
-    $this->assertEqual($entity->{$this->field_name}[$langcode][0]['value'], $value, 'Field value was saved');
+    $this->assertText(t('entity_test @id has been created.', array('@id' => $id)), 'Entity was created');
+    $entity = entity_load('entity_test', $id);
+    $this->assertEqual($entity->{$this->field_name}->value, $value, 'Field value was saved');
 
     // Display edit form.
-    $this->drupalGet('test-entity/manage/' . $id . '/edit');
+    $this->drupalGet('entity_test/manage/' . $id . '/edit');
     $this->assertFieldByName("{$this->field_name}[$langcode][0][value]", $value, 'Widget is displayed with the correct default value');
     $this->assertNoField("{$this->field_name}[$langcode][1][value]", 'No extraneous widget is displayed');
 
     // Update the entity.
     $value = mt_rand(1, 127);
-    $edit = array("{$this->field_name}[$langcode][0][value]" => $value);
+    $edit = array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
+      "{$this->field_name}[$langcode][0][value]" => $value,
+    );
     $this->drupalPost(NULL, $edit, t('Save'));
-    $this->assertRaw(t('test_entity @id has been updated.', array('@id' => $id)), 'Entity was updated');
-    $this->container->get('plugin.manager.entity')->getStorageController('test_entity')->resetCache(array($id));
-    $entity = field_test_entity_test_load($id);
-    $this->assertEqual($entity->{$this->field_name}[$langcode][0]['value'], $value, 'Field value was updated');
+    $this->assertText(t('entity_test @id has been updated.', array('@id' => $id)), 'Entity was updated');
+    $this->container->get('plugin.manager.entity')->getStorageController('entity_test')->resetCache(array($id));
+    $entity = entity_load('entity_test', $id);
+    $this->assertEqual($entity->{$this->field_name}->value, $value, 'Field value was updated');
 
     // Empty the field.
     $value = '';
-    $edit = array("{$this->field_name}[$langcode][0][value]" => $value);
-    $this->drupalPost('test-entity/manage/' . $id . '/edit', $edit, t('Save'));
-    $this->assertRaw(t('test_entity @id has been updated.', array('@id' => $id)), 'Entity was updated');
-    $this->container->get('plugin.manager.entity')->getStorageController('test_entity')->resetCache(array($id));
-    $entity = field_test_entity_test_load($id);
-    $this->assertIdentical($entity->{$this->field_name}, array(), 'Field was emptied');
+    $edit = array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
+      "{$this->field_name}[$langcode][0][value]" => $value
+    );
+    $this->drupalPost('entity_test/manage/' . $id . '/edit', $edit, t('Save'));
+    $this->assertText(t('entity_test @id has been updated.', array('@id' => $id)), 'Entity was updated');
+    $this->container->get('plugin.manager.entity')->getStorageController('entity_test')->resetCache(array($id));
+    $entity = entity_load('entity_test', $id);
+    $this->assertTrue($entity->{$this->field_name}->isEmpty(), 'Field was emptied');
   }
 
   /**
@@ -128,18 +144,22 @@ function testFieldFormDefaultValue() {
     $langcode = LANGUAGE_NOT_SPECIFIED;
 
     // Display creation form.
-    $this->drupalGet('test-entity/add/test_bundle');
+    $this->drupalGet('entity_test/add');
     // Test that the default value is displayed correctly.
     $this->assertFieldByXpath("//input[@name='{$this->field_name}[$langcode][0][value]' and @value='$default']");
 
     // Try to submit an empty value.
-    $edit = array("{$this->field_name}[$langcode][0][value]" => '');
+    $edit = array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
+      "{$this->field_name}[$langcode][0][value]" => '',
+    );
     $this->drupalPost(NULL, $edit, t('Save'));
-    preg_match('|test-entity/manage/(\d+)/edit|', $this->url, $match);
+    preg_match('|entity_test/manage/(\d+)/edit|', $this->url, $match);
     $id = $match[1];
-    $this->assertRaw(t('test_entity @id has been created.', array('@id' => $id)), 'Entity was created.');
-    $entity = field_test_entity_test_load($id);
-    $this->assertTrue(empty($entity->{$this->field_name}), 'Field is now empty.');
+    $this->assertText(t('entity_test @id has been created.', array('@id' => $id)), 'Entity was created.');
+    $entity = entity_load('entity_test', $id);
+    $this->assertTrue($entity->{$this->field_name}->isEmpty(), 'Field is now empty.');
   }
 
   function testFieldFormSingleRequired() {
@@ -153,23 +173,31 @@ function testFieldFormSingleRequired() {
 
     // Submit with missing required value.
     $edit = array();
-    $this->drupalPost('test-entity/add/test_bundle', $edit, t('Save'));
+    $this->drupalPost('entity_test/add', $edit, t('Save'));
     $this->assertRaw(t('!name field is required.', array('!name' => $this->instance['label'])), 'Required field with no value fails validation');
 
     // Create an entity
     $value = mt_rand(1, 127);
-    $edit = array("{$this->field_name}[$langcode][0][value]" => $value);
+    $edit = array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
+      "{$this->field_name}[$langcode][0][value]" => $value,
+    );
     $this->drupalPost(NULL, $edit, t('Save'));
-    preg_match('|test-entity/manage/(\d+)/edit|', $this->url, $match);
+    preg_match('|entity_test/manage/(\d+)/edit|', $this->url, $match);
     $id = $match[1];
-    $this->assertRaw(t('test_entity @id has been created.', array('@id' => $id)), 'Entity was created');
-    $entity = field_test_entity_test_load($id);
-    $this->assertEqual($entity->{$this->field_name}[$langcode][0]['value'], $value, 'Field value was saved');
+    $this->assertText(t('entity_test @id has been created.', array('@id' => $id)), 'Entity was created');
+    $entity = entity_load('entity_test', $id);
+    $this->assertEqual($entity->{$this->field_name}->value, $value, 'Field value was saved');
 
     // Edit with missing required value.
     $value = '';
-    $edit = array("{$this->field_name}[$langcode][0][value]" => $value);
-    $this->drupalPost('test-entity/manage/' . $id . '/edit', $edit, t('Save'));
+    $edit = array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
+      "{$this->field_name}[$langcode][0][value]" => $value,
+    );
+    $this->drupalPost('entity_test/manage/' . $id . '/edit', $edit, t('Save'));
     $this->assertRaw(t('!name field is required.', array('!name' => $this->instance['label'])), 'Required field with no value fails validation');
   }
 
@@ -190,7 +218,7 @@ function testFieldFormUnlimited() {
     $langcode = LANGUAGE_NOT_SPECIFIED;
 
     // Display creation form -> 1 widget.
-    $this->drupalGet('test-entity/add/test_bundle');
+    $this->drupalGet('entity_test/add');
     $this->assertFieldByName("{$this->field_name}[$langcode][0][value]", '', 'Widget 1 is displayed');
     $this->assertNoField("{$this->field_name}[$langcode][1][value]", 'No extraneous widget is displayed');
 
@@ -207,7 +235,11 @@ function testFieldFormUnlimited() {
     // Prepare values and weights.
     $count = 3;
     $delta_range = $count - 1;
-    $values = $weights = $pattern = $expected_values = $edit = array();
+    $values = $weights = $pattern = $expected_values = array();
+    $edit = array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
+    );
     for ($delta = 0; $delta <= $delta_range; $delta++) {
       // Assign unique random values and weights.
       do {
@@ -222,6 +254,7 @@ function testFieldFormUnlimited() {
       $values[$delta] = $value;
       $weights[$delta] = $weight;
       $field_values[$weight]['value'] = (string) $value;
+      $field_values[$weight]['additional_key'] = NULL;
       $pattern[$weight] = "<input [^>]*value=\"$value\" [^>]*";
     }
 
@@ -240,13 +273,13 @@ function testFieldFormUnlimited() {
 
     // Submit the form and create the entity.
     $this->drupalPost(NULL, $edit, t('Save'));
-    preg_match('|test-entity/manage/(\d+)/edit|', $this->url, $match);
+    preg_match('|entity_test/manage/(\d+)/edit|', $this->url, $match);
     $id = $match[1];
-    $this->assertRaw(t('test_entity @id has been created.', array('@id' => $id)), 'Entity was created');
-    $entity = field_test_entity_test_load($id);
+    $this->assertText(t('entity_test @id has been created.', array('@id' => $id)), 'Entity was created');
+    $entity = entity_load('entity_test', $id);
     ksort($field_values);
     $field_values = array_values($field_values);
-    $this->assertIdentical($entity->{$this->field_name}[$langcode], $field_values, 'Field values were saved in the correct order');
+    $this->assertIdentical($entity->{$this->field_name}->getValue(), $field_values, 'Field values were saved in the correct order');
 
     // Display edit form: check that the expected number of widgets is
     // displayed, with correct values change values, reorder, leave an empty
@@ -279,8 +312,8 @@ function testFieldFormMultivalueWithRequiredRadio() {
     ));
     $instance = array(
       'field_name' => 'required_radio_test',
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
       'required' => TRUE,
       'widget' => array(
         'type' => 'options_buttons',
@@ -289,7 +322,7 @@ function testFieldFormMultivalueWithRequiredRadio() {
     field_create_instance($instance);
 
     // Display creation form.
-    $this->drupalGet('test-entity/add/test_bundle');
+    $this->drupalGet('entity_test/add');
 
     // Press the 'Add more' button.
     $this->drupalPost(NULL, array(), t('Add another item'));
@@ -312,7 +345,7 @@ function testFieldFormJSAddMore() {
     $langcode = LANGUAGE_NOT_SPECIFIED;
 
     // Display creation form -> 1 widget.
-    $this->drupalGet('test-entity/add/test_bundle');
+    $this->drupalGet('entity_test/add');
 
     // Press 'add more' button a couple times -> 3 widgets.
     // drupalPostAJAX() will not work iteratively, so we add those through
@@ -372,21 +405,25 @@ function testFieldFormMultipleWidget() {
     $langcode = LANGUAGE_NOT_SPECIFIED;
 
     // Display creation form.
-    $this->drupalGet('test-entity/add/test_bundle');
+    $this->drupalGet('entity_test/add');
     $this->assertFieldByName("{$this->field_name}[$langcode]", '', 'Widget is displayed.');
 
     // Create entity with three values.
-    $edit = array("{$this->field_name}[$langcode]" => '1, 2, 3');
+    $edit = array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
+      "{$this->field_name}[$langcode]" => '1, 2, 3',
+    );
     $this->drupalPost(NULL, $edit, t('Save'));
-    preg_match('|test-entity/manage/(\d+)/edit|', $this->url, $match);
+    preg_match('|entity_test/manage/(\d+)/edit|', $this->url, $match);
     $id = $match[1];
 
     // Check that the values were saved.
-    $entity_init = field_test_create_entity($id);
+    $entity_init = entity_load('entity_test', $id);
     $this->assertFieldValues($entity_init, $this->field_name, $langcode, array(1, 2, 3));
 
     // Display the form, check that the values are correctly filled in.
-    $this->drupalGet('test-entity/manage/' . $id . '/edit');
+    $this->drupalGet('entity_test/manage/' . $id . '/edit');
     $this->assertFieldByName("{$this->field_name}[$langcode]", '1, 2, 3', 'Widget is displayed.');
 
     // Submit the form with more values than the field accepts.
@@ -404,8 +441,11 @@ function testFieldFormAccess() {
     // Create a "regular" field.
     $field = $this->field_single;
     $field_name = $field['field_name'];
+    $entity_type = 'entity_test_rev';
     $instance = $this->instance;
     $instance['field_name'] = $field_name;
+    $instance['entity_type'] = $entity_type;
+    $instance['bundle'] = $entity_type;
     field_create_field($field);
     field_create_instance($instance);
 
@@ -417,8 +457,8 @@ function testFieldFormAccess() {
     $field_name_no_access = $field_no_access['field_name'];
     $instance_no_access = array(
       'field_name' => $field_name_no_access,
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => $entity_type,
+      'bundle' => $entity_type,
       'default_value' => array(0 => array('value' => 99)),
     );
     field_create_field($field_no_access);
@@ -428,52 +468,60 @@ function testFieldFormAccess() {
 
     // Test that the form structure includes full information for each delta
     // apart from #access.
-    $entity_type = 'test_entity';
-    $entity = field_test_create_entity(0, 0, $this->instance['bundle']);
+    $entity = entity_create($entity_type, array('id' => 0, 'revision_id' => 0));
 
     $form = array();
     $form_state = form_state_defaults();
-    field_attach_form($entity, $form, $form_state);
+    field_attach_form($entity->getBCEntity(), $form, $form_state);
 
     $this->assertEqual($form[$field_name_no_access][$langcode][0]['value']['#entity_type'], $entity_type, 'The correct entity type is set in the field structure.');
     $this->assertFalse($form[$field_name_no_access]['#access'], 'Field #access is FALSE for the field without edit access.');
 
     // Display creation form.
-    $this->drupalGet('test-entity/add/test_bundle');
+    $this->drupalGet($entity_type . '/add');
     $this->assertNoFieldByName("{$field_name_no_access}[$langcode][0][value]", '', 'Widget is not displayed if field access is denied.');
 
     // Create entity.
-    $edit = array("{$field_name}[$langcode][0][value]" => 1);
+    $edit = array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
+      "{$field_name}[$langcode][0][value]" => 1,
+    );
     $this->drupalPost(NULL, $edit, t('Save'));
-    preg_match('|test-entity/manage/(\d+)/edit|', $this->url, $match);
+    preg_match("|$entity_type/manage/(\d+)/edit|", $this->url, $match);
     $id = $match[1];
 
     // Check that the default value was saved.
-    $entity = field_test_entity_test_load($id);
-    $this->assertEqual($entity->{$field_name_no_access}[$langcode][0]['value'], 99, 'Default value was saved for the field with no edit access.');
-    $this->assertEqual($entity->{$field_name}[$langcode][0]['value'], 1, 'Entered value vas saved for the field with edit access.');
+    $entity = entity_load($entity_type, $id);
+    $this->assertEqual($entity->$field_name_no_access->value, 99, 'Default value was saved for the field with no edit access.');
+    $this->assertEqual($entity->$field_name->value, 1, 'Entered value vas saved for the field with edit access.');
 
     // Create a new revision.
-    $edit = array("{$field_name}[$langcode][0][value]" => 2, 'revision' => TRUE);
-    $this->drupalPost('test-entity/manage/' . $id . '/edit', $edit, t('Save'));
+    $edit = array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
+      "{$field_name}[$langcode][0][value]" => 2,
+      'revision' => TRUE,
+    );
+    $this->drupalPost($entity_type . '/manage/' . $id . '/edit', $edit, t('Save'));
 
     // Check that the new revision has the expected values.
-    $this->container->get('plugin.manager.entity')->getStorageController('test_entity')->resetCache(array($id));
-    $entity = field_test_entity_test_load($id);
-    $this->assertEqual($entity->{$field_name_no_access}[$langcode][0]['value'], 99, 'New revision has the expected value for the field with no edit access.');
-    $this->assertEqual($entity->{$field_name}[$langcode][0]['value'], 2, 'New revision has the expected value for the field with edit access.');
+    $this->container->get('plugin.manager.entity')->getStorageController($entity_type)->resetCache(array($id));
+    $entity = entity_load($entity_type, $id);
+    $this->assertEqual($entity->$field_name_no_access->value, 99, 'New revision has the expected value for the field with no edit access.');
+    $this->assertEqual($entity->$field_name->value, 2, 'New revision has the expected value for the field with edit access.');
 
     // Check that the revision is also saved in the revisions table.
-    $entity = field_test_entity_test_load($id, $entity->ftvid);
-    $this->assertEqual($entity->{$field_name_no_access}[$langcode][0]['value'], 99, 'New revision has the expected value for the field with no edit access.');
-    $this->assertEqual($entity->{$field_name}[$langcode][0]['value'], 2, 'New revision has the expected value for the field with edit access.');
+    $entity = entity_revision_load($entity_type, $entity->getRevisionId());
+    $this->assertEqual($entity->$field_name_no_access->value, 99, 'New revision has the expected value for the field with no edit access.');
+    $this->assertEqual($entity->$field_name->value, 2, 'New revision has the expected value for the field with edit access.');
   }
 
   /**
    * Tests Field API form integration within a subform.
    */
   function testNestedFieldForm() {
-    // Add two instances on the 'test_bundle'
+    // Add two instances on the 'entity_test'
     field_create_field($this->field_single);
     field_create_field($this->field_unlimited);
     $this->instance['field_name'] = 'field_single';
diff --git a/core/modules/field/lib/Drupal/field/Tests/TranslationTest.php b/core/modules/field/lib/Drupal/field/Tests/TranslationTest.php
index 609d70f..8280920 100644
--- a/core/modules/field/lib/Drupal/field/Tests/TranslationTest.php
+++ b/core/modules/field/lib/Drupal/field/Tests/TranslationTest.php
@@ -41,7 +41,7 @@ function setUp() {
 
     $this->field_name = drupal_strtolower($this->randomName() . '_field_name');
 
-    $this->entity_type = 'test_entity';
+    $this->entity_type = 'entity_test';
 
     $field = array(
       'field_name' => $this->field_name,
@@ -55,10 +55,10 @@ function setUp() {
     $instance = array(
       'field_name' => $this->field_name,
       'entity_type' => $this->entity_type,
-      'bundle' => 'test_bundle',
+      'bundle' => 'entity_test',
     );
     field_create_instance($instance);
-    $this->instance = field_read_instance('test_entity', $this->field_name, 'test_bundle');
+    $this->instance = field_read_instance('entity_test', $this->field_name, 'entity_test');
 
     for ($i = 0; $i < 3; ++$i) {
       $language = new Language(array(
@@ -74,12 +74,12 @@ function setUp() {
    */
   function testFieldAvailableLanguages() {
     // Test 'translatable' fieldable info.
-    field_test_entity_info_translatable('test_entity', FALSE);
+    field_test_entity_info_translatable('entity_test', FALSE);
     $field = $this->field;
     $field['field_name'] .= '_untranslatable';
 
     // Enable field translations for the entity.
-    field_test_entity_info_translatable('test_entity', TRUE);
+    field_test_entity_info_translatable('entity_test', TRUE);
 
     // Test hook_field_languages() invocation on a translatable field.
     state()->set('field_test.field_available_languages_alter', TRUE);
@@ -105,9 +105,9 @@ function testFieldAvailableLanguages() {
    */
   function testFieldInvoke() {
     // Enable field translations for the entity.
-    field_test_entity_info_translatable('test_entity', TRUE);
+    field_test_entity_info_translatable('entity_test', TRUE);
 
-    $entity_type = 'test_entity';
+    $entity_type = 'entity_test';
     $entity = field_test_create_entity(0, 0, $this->instance['bundle']);
 
     // Populate some extra languages to check if _field_invoke() correctly uses
@@ -143,12 +143,12 @@ function testFieldInvoke() {
    */
   function testFieldInvokeMultiple() {
     // Enable field translations for the entity.
-    field_test_entity_info_translatable('test_entity', TRUE);
+    field_test_entity_info_translatable('entity_test', TRUE);
 
     $values = array();
     $options = array();
     $entities = array();
-    $entity_type = 'test_entity';
+    $entity_type = 'entity_test';
     $entity_count = 5;
     $available_langcodes = field_available_languages($this->entity_type, $this->field);
 
@@ -221,9 +221,9 @@ function testTranslatableFieldSaveLoad() {
     $this->assertTrue(count($entity_info['translation']), 'Nodes are translatable.');
 
     // Prepare the field translations.
-    field_test_entity_info_translatable('test_entity', TRUE);
+    field_test_entity_info_translatable('entity_test', TRUE);
     $eid = $evid = 1;
-    $entity_type = 'test_entity';
+    $entity_type = 'entity_test';
     $entity = field_test_create_entity($eid, $evid, $this->instance['bundle']);
     $field_translations = array();
     $available_langcodes = field_available_languages($entity_type, $this->field);
@@ -299,7 +299,7 @@ function testTranslatableFieldSaveLoad() {
    */
   function testFieldDisplayLanguage() {
     $field_name = drupal_strtolower($this->randomName() . '_field_name');
-    $entity_type = 'test_entity';
+    $entity_type = 'entity_test';
 
     // We need an additional field here to properly test display language
     // suggestions.
@@ -314,7 +314,7 @@ function testFieldDisplayLanguage() {
     $instance = array(
       'field_name' => $field['field_name'],
       'entity_type' => $entity_type,
-      'bundle' => 'test_bundle',
+      'bundle' => 'entity_test',
     );
     field_create_instance($instance);
 
diff --git a/core/modules/field/tests/modules/field_test/field_test.entity.inc b/core/modules/field/tests/modules/field_test/field_test.entity.inc
index 81c116d..a513ab7 100644
--- a/core/modules/field/tests/modules/field_test/field_test.entity.inc
+++ b/core/modules/field/tests/modules/field_test/field_test.entity.inc
@@ -23,45 +23,6 @@ function field_test_entity_info_alter(&$entity_info) {
 }
 
 /**
- * Implements hook_entity_view_mode_info_alter().
- */
-function field_test_entity_view_mode_info_alter(&$view_modes) {
-  $entity_info = entity_get_info();
-  foreach ($entity_info as $entity_type => $info) {
-    if ($entity_info[$entity_type]['module'] == 'field_test') {
-      $view_modes[$entity_type] = array(
-        'full' => array(
-          'label' => t('Full object'),
-          'custom_settings' => TRUE,
-        ),
-        'teaser' => array(
-          'label' => t('Teaser'),
-          'custom_settings' => TRUE,
-        ),
-      );
-    }
-  }
-}
-
-/**
- * Implements hook_entity_bundle_info_alter().
- */
-function field_test_entity_bundle_info_alter(&$bundles) {
-  $entity_info = entity_get_info();
-  foreach ($bundles as $entity_type => $info) {
-    if ($entity_info[$entity_type]['module'] == 'field_test') {
-      $bundles[$entity_type] = state()->get('field_test_bundles') ?: array('test_bundle' => array('label' => 'Test Bundle'));
-      if ($entity_type == 'test_entity_bundle') {
-        $bundles[$entity_type] += array('test_entity_2' => array('label' => 'Test entity 2'));
-      }
-      if ($entity_type == 'test_entity_bundle_key') {
-        $bundles[$entity_type] += array('bundle1' => array('label' => 'Bundle1'), 'bundle2' => array('label' => 'Bundle2'));
-      }
-    }
-  }
-}
-
-/**
  * Helper function to enable entity translations.
  */
 function field_test_entity_info_translatable($entity_type = NULL, $translatable = NULL) {
@@ -75,28 +36,6 @@ function field_test_entity_info_translatable($entity_type = NULL, $translatable
 }
 
 /**
- * Creates a new bundle for test_entity entities.
- *
- * @param $bundle
- *   The machine-readable name of the bundle.
- * @param $text
- *   The human-readable name of the bundle. If none is provided, the machine
- *   name will be used.
- */
-function field_test_create_bundle($bundle, $text = NULL) {
-  $bundles = state()->get('field_test.bundles') ?: array('test_bundle' => array('label' => 'Test Bundle'));
-  $bundles += array($bundle => array('label' => $text ? $text : $bundle));
-  state()->set('field_test.bundles', $bundles);
-
-  $info = entity_get_info();
-  foreach ($info as $type => $type_info) {
-    if ($type_info['module'] == 'field_test') {
-      field_attach_create_bundle($type, $bundle);
-    }
-  }
-}
-
-/**
  * Renames a bundle for test_entity entities.
  *
  * @param $bundle_old
@@ -252,11 +191,11 @@ function field_test_entity_nested_form($form, &$form_state, $entity_1, $entity_2
  * Validate handler for field_test_entity_nested_form().
  */
 function field_test_entity_nested_form_validate($form, &$form_state) {
-  $entity_1 = entity_create('test_entity', $form_state['values']);
+  $entity_1 = entity_create('entity_test', $form_state['values']);
   field_attach_extract_form_values($entity_1, $form, $form_state);
   field_attach_form_validate($entity_1, $form, $form_state);
 
-  $entity_2 = entity_create('test_entity', $form_state['values']['entity_2']);
+  $entity_2 = entity_create('entity_test', $form_state['values']['entity_2']);
   field_attach_extract_form_values($entity_2, $form['entity_2'], $form_state);
   field_attach_form_validate($entity_2, $form['entity_2'], $form_state);
 }
@@ -265,11 +204,11 @@ function field_test_entity_nested_form_validate($form, &$form_state) {
  * Submit handler for field_test_entity_nested_form().
  */
 function field_test_entity_nested_form_submit($form, &$form_state) {
-  $entity_1 = entity_create('test_entity', $form_state['values']);
+  $entity_1 = entity_create('entity_test', $form_state['values']);
   field_attach_extract_form_values($entity_1, $form, $form_state);
   field_test_entity_save($entity_1);
 
-  $entity_2 = entity_create('test_entity', $form_state['values']['entity_2']);
+  $entity_2 = entity_create('entity_test', $form_state['values']['entity_2']);
   field_attach_extract_form_values($entity_2, $form['entity_2'], $form_state);
   field_test_entity_save($entity_2);
 
diff --git a/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/Core/Entity/TestEntity.php b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/Core/Entity/TestEntity.php
index be75dc0..51c8f17 100644
--- a/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/Core/Entity/TestEntity.php
+++ b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Plugin/Core/Entity/TestEntity.php
@@ -19,7 +19,6 @@
  *   label = @Translation("Test Entity"),
  *   module = "field_test",
  *   controller_class = "Drupal\field_test\TestEntityController",
- *   render_controller_class = "Drupal\Core\Entity\EntityRenderController",
  *   form_controller_class = {
  *     "default" = "Drupal\field_test\TestEntityFormController"
  *   },
diff --git a/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/TestEntityFormController.php b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/TestEntityFormController.php
index 93ef2aa..5c4bdf7 100644
--- a/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/TestEntityFormController.php
+++ b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/TestEntityFormController.php
@@ -40,11 +40,11 @@ public function save(array $form, array &$form_state) {
     $is_new = $entity->isNew();
     $entity->save();
 
-    $message = $is_new ? t('test_entity @id has been created.', array('@id' => $entity->id())) : t('test_entity @id has been updated.', array('@id' => $entity->id()));
+    $message = $is_new ? t('entity_test @id has been created.', array('@id' => $entity->id())) : t('test_entity @id has been updated.', array('@id' => $entity->id()));
     drupal_set_message($message);
 
     if ($entity->id()) {
-      $form_state['redirect'] = 'test-entity/manage/' . $entity->id() . '/edit';
+      $form_state['redirect'] = 'entity_test/manage/' . $entity->id() . '/edit';
     }
     else {
       // Error on save.
diff --git a/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Type/TestItem.php b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Type/TestItem.php
index 0c61d15..bc3b9fd 100644
--- a/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Type/TestItem.php
+++ b/core/modules/field/tests/modules/field_test/lib/Drupal/field_test/Type/TestItem.php
@@ -33,6 +33,10 @@ public function getPropertyDefinitions() {
         'type' => 'integer',
         'label' => t('Test integer value'),
       );
+      static::$propertyDefinitions['additional_key'] = array(
+        'type' => 'string',
+        'label' => t('Additional test value'),
+      );
     }
     return static::$propertyDefinitions;
   }
diff --git a/core/modules/field_sql_storage/lib/Drupal/field_sql_storage/Tests/FieldSqlStorageTest.php b/core/modules/field_sql_storage/lib/Drupal/field_sql_storage/Tests/FieldSqlStorageTest.php
index 5ea9c88..0fa192f 100644
--- a/core/modules/field_sql_storage/lib/Drupal/field_sql_storage/Tests/FieldSqlStorageTest.php
+++ b/core/modules/field_sql_storage/lib/Drupal/field_sql_storage/Tests/FieldSqlStorageTest.php
@@ -26,7 +26,7 @@ class FieldSqlStorageTest extends EntityUnitTestBase {
    *
    * @var array
    */
-  public static $modules = array('field_test', 'text', 'number');
+  public static $modules = array('field_sql_storage', 'field', 'field_test', 'text', 'number', 'entity_test');
 
   public static function getInfo() {
     return array(
@@ -38,15 +38,16 @@ public static function getInfo() {
 
   function setUp() {
     parent::setUp();
-    $this->installSchema('field_test', array('test_entity', 'test_entity_revision', 'test_entity_bundle'));
+    $this->installSchema('entity_test', array('entity_test_rev', 'entity_test_rev_revision'));
+    $entity_type = 'entity_test_rev';
 
     $this->field_name = strtolower($this->randomName());
     $this->field = array('field_name' => $this->field_name, 'type' => 'test_field', 'cardinality' => 4);
     $this->field = field_create_field($this->field);
     $this->instance = array(
       'field_name' => $this->field_name,
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle'
+      'entity_type' => $entity_type,
+      'bundle' => $entity_type
     );
     $this->instance = field_create_instance($this->instance);
     $this->table = _field_sql_storage_tablename($this->field);
@@ -59,7 +60,7 @@ function setUp() {
    * field_load_revision works correctly.
    */
   function testFieldAttachLoad() {
-    $entity_type = 'test_entity';
+    $entity_type = 'entity_test_rev';
     $eid = 0;
     $langcode = LANGUAGE_NOT_SPECIFIED;
 
@@ -86,27 +87,33 @@ function testFieldAttachLoad() {
     $query->execute();
 
     // Load the "most current revision"
-    $entity = field_test_create_entity($eid, 0, $this->instance['bundle']);
-    field_attach_load($entity_type, array($eid => $entity));
+    $entity = entity_create($entity_type, array(
+      'id' => 0,
+      'revision_id' => 0,
+    ));
+    field_attach_load($entity_type, array($eid => $entity->getBCEntity()));
     foreach ($values[0] as $delta => $value) {
       if ($delta < $this->field['cardinality']) {
-        $this->assertEqual($entity->{$this->field_name}[$langcode][$delta]['value'], $value, "Value $delta is loaded correctly for current revision");
+        $this->assertEqual($entity->{$this->field_name}[$delta]->value, $value, "Value $delta is loaded correctly for current revision");
       }
       else {
-        $this->assertFalse(array_key_exists($delta, $entity->{$this->field_name}[$langcode]), "No extraneous value gets loaded for current revision.");
+        $this->assertFalse(array_key_exists($delta, $entity->{$this->field_name}), "No extraneous value gets loaded for current revision.");
       }
     }
 
     // Load every revision
     for ($evid = 0; $evid < 4; ++$evid) {
-      $entity = field_test_create_entity($eid, $evid, $this->instance['bundle']);
-      field_attach_load_revision($entity_type, array($eid => $entity));
+      $entity = entity_create($entity_type, array(
+        'id' => $eid,
+        'revision_id' => $evid,
+      ));
+      field_attach_load_revision($entity_type, array($eid => $entity->getBCEntity()));
       foreach ($values[$evid] as $delta => $value) {
         if ($delta < $this->field['cardinality']) {
-          $this->assertEqual($entity->{$this->field_name}[$langcode][$delta]['value'], $value, "Value $delta for revision $evid is loaded correctly");
+          $this->assertEqual($entity->{$this->field_name}[$delta]->value, $value, "Value $delta for revision $evid is loaded correctly");
         }
         else {
-          $this->assertFalse(array_key_exists($delta, $entity->{$this->field_name}[$langcode]), "No extraneous value gets loaded for revision $evid.");
+          $this->assertFalse(array_key_exists($delta, $entity->{$this->field_name}), "No extraneous value gets loaded for revision $evid.");
         }
       }
     }
@@ -115,11 +122,14 @@ function testFieldAttachLoad() {
     // loaded.
     $eid = $evid = 1;
     $unavailable_langcode = 'xx';
-    $entity = field_test_create_entity($eid, $evid, $this->instance['bundle']);
+    $entity = entity_create($entity_type, array(
+      'id' => $eid,
+      'revision_id' => $evid,
+    ));
     $values = array($entity_type, $eid, $evid, 0, $unavailable_langcode, mt_rand(1, 127));
     db_insert($this->table)->fields($columns)->values($values)->execute();
     db_insert($this->revision_table)->fields($columns)->values($values)->execute();
-    field_attach_load($entity_type, array($eid => $entity));
+    field_attach_load($entity_type, array($eid => $entity->getBCEntity()));
     $this->assertFalse(array_key_exists($unavailable_langcode, $entity->{$this->field_name}), 'Field translation in an unavailable language ignored');
   }
 
@@ -128,8 +138,11 @@ function testFieldAttachLoad() {
    * written when using insert and update.
    */
   function testFieldAttachInsertAndUpdate() {
-    $entity_type = 'test_entity';
-    $entity = field_test_create_entity(0, 0, $this->instance['bundle']);
+    $entity_type = 'entity_test_rev';
+    $entity = entity_create($entity_type, array(
+      'id' => 0,
+      'revision_id' => 0,
+    ));
     $langcode = LANGUAGE_NOT_SPECIFIED;
 
     // Test insert.
@@ -139,8 +152,8 @@ function testFieldAttachInsertAndUpdate() {
     for ($delta = 0; $delta <= $this->field['cardinality']; $delta++) {
       $values[$delta]['value'] = mt_rand(1, 127);
     }
-    $entity->{$this->field_name}[$langcode] = $rev_values[0] = $values;
-    field_attach_insert($entity);
+    $entity->{$this->field_name} = $rev_values[0] = $values;
+    field_attach_insert($entity->getBCEntity());
 
     $rows = db_select($this->table, 't')->fields('t')->execute()->fetchAllAssoc('delta', PDO::FETCH_ASSOC);
     foreach ($values as $delta => $value) {
@@ -153,14 +166,18 @@ function testFieldAttachInsertAndUpdate() {
     }
 
     // Test update.
-    $entity = field_test_create_entity(0, 1, $this->instance['bundle']);
+    $entity = entity_create($entity_type, array(
+      'id' => 0,
+      'revision_id' => 1,
+    ));
     $values = array();
     // Note: we try to update one extra value ('<=' instead of '<').
     for ($delta = 0; $delta <= $this->field['cardinality']; $delta++) {
       $values[$delta]['value'] = mt_rand(1, 127);
     }
-    $entity->{$this->field_name}[$langcode] = $rev_values[1] = $values;
-    field_attach_update($entity);
+    $rev_values[1] = $values;
+    $entity->{$this->field_name}->setValue($values);
+    field_attach_update($entity->getBCEntity());
     $rows = db_select($this->table, 't')->fields('t')->execute()->fetchAllAssoc('delta', PDO::FETCH_ASSOC);
     foreach ($values as $delta => $value) {
       if ($delta < $this->field['cardinality']) {
@@ -190,7 +207,7 @@ function testFieldAttachInsertAndUpdate() {
     // Check that update leaves the field data untouched if
     // $entity->{$field_name} is absent.
     unset($entity->{$this->field_name});
-    field_attach_update($entity);
+    field_attach_update($entity->getBCEntity());
     $rows = db_select($this->table, 't')->fields('t')->execute()->fetchAllAssoc('delta', PDO::FETCH_ASSOC);
     foreach ($values as $delta => $value) {
       if ($delta < $this->field['cardinality']) {
@@ -200,7 +217,7 @@ function testFieldAttachInsertAndUpdate() {
 
     // Check that update with an empty $entity->$field_name empties the field.
     $entity->{$this->field_name} = NULL;
-    field_attach_update($entity);
+    field_attach_update($entity->getBCEntity());
     $rows = db_select($this->table, 't')->fields('t')->execute()->fetchAllAssoc('delta', PDO::FETCH_ASSOC);
     $this->assertEqual(count($rows), 0, t("Update with an empty field_name entry empties the field."));
   }
@@ -209,12 +226,15 @@ function testFieldAttachInsertAndUpdate() {
    * Tests insert and update with missing or NULL fields.
    */
   function testFieldAttachSaveMissingData() {
-    $entity_type = 'test_entity';
-    $entity = field_test_create_entity(0, 0, $this->instance['bundle']);
+    $entity_type = 'entity_test_rev';
+    $entity = entity_create($entity_type, array(
+      'id' => 0,
+      'revision_id' => 0,
+    ));
     $langcode = LANGUAGE_NOT_SPECIFIED;
 
     // Insert: Field is missing
-    field_attach_insert($entity);
+    field_attach_insert($entity->getBCEntity());
     $count = db_select($this->table)
       ->countQuery()
       ->execute()
@@ -223,7 +243,7 @@ function testFieldAttachSaveMissingData() {
 
     // Insert: Field is NULL
     $entity->{$this->field_name} = NULL;
-    field_attach_insert($entity);
+    field_attach_insert($entity->getBCEntity());
     $count = db_select($this->table)
       ->countQuery()
       ->execute()
@@ -231,8 +251,8 @@ function testFieldAttachSaveMissingData() {
     $this->assertEqual($count, 0, 'NULL field results in no inserts');
 
     // Add some real data
-    $entity->{$this->field_name}[$langcode] = array(0 => array('value' => 1));
-    field_attach_insert($entity);
+    $entity->{$this->field_name}->value = 1;
+    field_attach_insert($entity->getBCEntity());
     $count = db_select($this->table)
       ->countQuery()
       ->execute()
@@ -241,7 +261,7 @@ function testFieldAttachSaveMissingData() {
 
     // Update: Field is missing. Data should survive.
     unset($entity->{$this->field_name});
-    field_attach_update($entity);
+    field_attach_update($entity->getBCEntity());
     $count = db_select($this->table)
       ->countQuery()
       ->execute()
@@ -250,7 +270,7 @@ function testFieldAttachSaveMissingData() {
 
     // Update: Field is NULL. Data should be wiped.
     $entity->{$this->field_name} = NULL;
-    field_attach_update($entity);
+    field_attach_update($entity->getBCEntity());
     $count = db_select($this->table)
       ->countQuery()
       ->execute()
@@ -270,8 +290,8 @@ function testFieldAttachSaveMissingData() {
     $this->assertEqual($count, 1, 'Field translation in an unavailable language saved.');
 
     // Again add some real data.
-    $entity->{$this->field_name}[$langcode] = array(0 => array('value' => 1));
-    field_attach_insert($entity);
+    $entity->{$this->field_name}->value = 1;
+    field_attach_insert($entity->getBCEntity());
     $count = db_select($this->table)
       ->countQuery()
       ->execute()
@@ -280,9 +300,9 @@ function testFieldAttachSaveMissingData() {
 
     // Update: Field translation is missing but field is not empty. Translation
     // data should survive.
-    $entity->{$this->field_name}[$unavailable_langcode] = array(mt_rand(1, 127));
+    $entity->set($this->field_name, $unavailable_langcode, array(mt_rand(1, 127)));
     unset($entity->{$this->field_name}[$langcode]);
-    field_attach_update($entity);
+    field_attach_update($entity->getBCEntity());
     $count = db_select($this->table)
       ->countQuery()
       ->execute()
@@ -292,7 +312,7 @@ function testFieldAttachSaveMissingData() {
     // Update: Field translation is NULL but field is not empty. Translation
     // data should be wiped.
     $entity->{$this->field_name}[$langcode] = NULL;
-    field_attach_update($entity);
+    field_attach_update($entity->getBCEntity());
     $count = db_select($this->table)
       ->countQuery()
       ->execute()
@@ -304,13 +324,17 @@ function testFieldAttachSaveMissingData() {
    * Test trying to update a field with data.
    */
   function testUpdateFieldSchemaWithData() {
+    $entity_type = 'entity_test_rev';
     // Create a decimal 5.2 field and add some data.
     $field = array('field_name' => 'decimal52', 'type' => 'number_decimal', 'settings' => array('precision' => 5, 'scale' => 2));
     $field = field_create_field($field);
-    $instance = array('field_name' => 'decimal52', 'entity_type' => 'test_entity', 'bundle' => 'test_bundle');
+    $instance = array('field_name' => 'decimal52', 'entity_type' => $entity_type, 'bundle' => $entity_type);
     $instance = field_create_instance($instance);
-    $entity = field_test_create_entity(0, 0, $instance['bundle']);
-    $entity->decimal52[LANGUAGE_NOT_SPECIFIED][0]['value'] = '1.235';
+    $entity = entity_create($entity_type, array(
+      'id' => 0,
+      'revision_id' => 0,
+    ));
+    $entity->decimal52->value = '1.235';
     $entity->save();
 
     // Attempt to update the field in a way that would work without data.
@@ -353,12 +377,13 @@ function testFieldUpdateFailure() {
    * Test adding and removing indexes while data is present.
    */
   function testFieldUpdateIndexesWithData() {
+    $entity_type = 'entity_test_rev';
 
     // Create a decimal field.
     $field_name = 'testfield';
     $field = array('field_name' => $field_name, 'type' => 'text');
     $field = field_create_field($field);
-    $instance = array('field_name' => $field_name, 'entity_type' => 'test_entity', 'bundle' => 'test_bundle');
+    $instance = array('field_name' => $field_name, 'entity_type' => $entity_type, 'bundle' => $entity_type);
     $instance = field_create_instance($instance);
     $tables = array(_field_sql_storage_tablename($field), _field_sql_storage_revision_tablename($field));
 
@@ -369,8 +394,12 @@ function testFieldUpdateIndexesWithData() {
     }
 
     // Add data so the table cannot be dropped.
-    $entity = field_test_create_entity(1, 1, $instance['bundle']);
-    $entity->{$field_name}[LANGUAGE_NOT_SPECIFIED][0]['value'] = 'field data';
+    $entity = entity_create($entity_type, array(
+      'id' => 1,
+      'revision_id' => 1,
+    ));
+    $entity->$field_name->value = 'field data';
+    $entity->enforceIsNew();
     $entity->save();
 
     // Add an index
@@ -389,9 +418,12 @@ function testFieldUpdateIndexesWithData() {
     }
 
     // Verify that the tables were not dropped.
-    $entity = field_test_create_entity(1, 1, $instance['bundle']);
-    field_attach_load('test_entity', array(1 => $entity));
-    $this->assertEqual($entity->{$field_name}[LANGUAGE_NOT_SPECIFIED][0]['value'], 'field data', t("Index changes performed without dropping the tables"));
+    $entity = entity_create($entity_type, array(
+      'id' => 1,
+      'revision_id' => 1,
+    ));
+    field_attach_load($entity_type, array(1 => $entity->getBCEntity()));
+    $this->assertEqual($entity->$field_name->value, 'field data', t("Index changes performed without dropping the tables"));
   }
 
   /**
diff --git a/core/modules/link/lib/Drupal/link/Tests/LinkFieldTest.php b/core/modules/link/lib/Drupal/link/Tests/LinkFieldTest.php
index a608873..f83e2c6 100644
--- a/core/modules/link/lib/Drupal/link/Tests/LinkFieldTest.php
+++ b/core/modules/link/lib/Drupal/link/Tests/LinkFieldTest.php
@@ -19,7 +19,7 @@ class LinkFieldTest extends WebTestBase {
    *
    * @var array
    */
-  public static $modules = array('field_test', 'link');
+  public static $modules = array('entity_test', 'link');
 
   public static function getInfo() {
     return array(
@@ -33,8 +33,8 @@ function setUp() {
     parent::setUp();
 
     $this->web_user = $this->drupalCreateUser(array(
-      'access field_test content',
-      'administer field_test content',
+      'view test entity',
+      'administer entity_test content',
     ));
     $this->drupalLogin($this->web_user);
   }
@@ -51,8 +51,8 @@ function testURLValidation() {
     field_create_field($this->field);
     $this->instance = array(
       'field_name' => $this->field['field_name'],
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
       'settings' => array(
         'title' => DRUPAL_DISABLED,
       ),
@@ -64,7 +64,7 @@ function testURLValidation() {
       ),
     );
     field_create_instance($this->instance);
-    entity_get_display('test_entity', 'test_bundle', 'full')
+    entity_get_display('entity_test', 'entity_test', 'full')
       ->setComponent($this->field['field_name'], array(
         'type' => 'link',
       ))
@@ -73,19 +73,21 @@ function testURLValidation() {
     $langcode = LANGUAGE_NOT_SPECIFIED;
 
     // Display creation form.
-    $this->drupalGet('test-entity/add/test_bundle');
+    $this->drupalGet('entity_test/add');
     $this->assertFieldByName("{$this->field['field_name']}[$langcode][0][url]", '', 'Link URL field is displayed');
     $this->assertRaw('placeholder="http://example.com"');
 
     // Verify that a valid URL can be submitted.
     $value = 'http://www.example.com/';
     $edit = array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
       "{$this->field['field_name']}[$langcode][0][url]" => $value,
     );
     $this->drupalPost(NULL, $edit, t('Save'));
-    preg_match('|test-entity/manage/(\d+)/edit|', $this->url, $match);
+    preg_match('|entity_test/manage/(\d+)/edit|', $this->url, $match);
     $id = $match[1];
-    $this->assertRaw(t('test_entity @id has been created.', array('@id' => $id)));
+    $this->assertText(t('entity_test @id has been created.', array('@id' => $id)));
     $this->assertRaw($value);
 
     // Verify that invalid URLs cannot be submitted.
@@ -97,9 +99,11 @@ function testURLValidation() {
       // Missing host name
       'http://',
     );
-    $this->drupalGet('test-entity/add/test_bundle');
+    $this->drupalGet('entity_test/add');
     foreach ($wrong_entries as $invalid_value) {
       $edit = array(
+        'user_id' => 1,
+        'name' => $this->randomName(),
         "{$this->field['field_name']}[$langcode][0][url]" => $invalid_value,
       );
       $this->drupalPost(NULL, $edit, t('Save'));
@@ -119,8 +123,8 @@ function testLinkTitle() {
     field_create_field($this->field);
     $this->instance = array(
       'field_name' => $this->field['field_name'],
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
       'settings' => array(
         'title' => DRUPAL_OPTIONAL,
       ),
@@ -133,7 +137,7 @@ function testLinkTitle() {
       ),
     );
     field_create_instance($this->instance);
-    entity_get_display('test_entity', 'test_bundle', 'full')
+    entity_get_display('entity_test', 'entity_test', 'full')
       ->setComponent($this->field['field_name'], array(
         'type' => 'link',
         'label' => 'hidden',
@@ -149,7 +153,7 @@ function testLinkTitle() {
       field_update_instance($this->instance);
 
       // Display creation form.
-      $this->drupalGet('test-entity/add/test_bundle');
+      $this->drupalGet('entity_test/add');
       $this->assertFieldByName("{$this->field['field_name']}[$langcode][0][url]", '', 'URL field found.');
       $this->assertRaw('placeholder="http://example.com"');
 
@@ -177,7 +181,7 @@ function testLinkTitle() {
           $this->assertNoText(t('!name field is required.', array('!name' => t('Title'))));
 
           // Verify that a URL and title meets requirements.
-          $this->drupalGet('test-entity/add/test_bundle');
+          $this->drupalGet('entity_test/add');
           $edit = array(
             "{$this->field['field_name']}[$langcode][0][url]" => 'http://www.example.com',
             "{$this->field['field_name']}[$langcode][0][title]" => 'Example',
@@ -191,13 +195,15 @@ function testLinkTitle() {
     // Verify that a link without title is rendered using the URL as link text.
     $value = 'http://www.example.com/';
     $edit = array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
       "{$this->field['field_name']}[$langcode][0][url]" => $value,
       "{$this->field['field_name']}[$langcode][0][title]" => '',
     );
     $this->drupalPost(NULL, $edit, t('Save'));
-    preg_match('|test-entity/manage/(\d+)/edit|', $this->url, $match);
+    preg_match('|entity_test/manage/(\d+)/edit|', $this->url, $match);
     $id = $match[1];
-    $this->assertRaw(t('test_entity @id has been created.', array('@id' => $id)));
+    $this->assertText(t('entity_test @id has been created.', array('@id' => $id)));
 
     $this->renderTestEntity($id);
     $expected_link = l($value, $value);
@@ -206,10 +212,12 @@ function testLinkTitle() {
     // Verify that a link with title is rendered using the title as link text.
     $title = $this->randomName();
     $edit = array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
       "{$this->field['field_name']}[$langcode][0][title]" => $title,
     );
-    $this->drupalPost("test-entity/manage/$id/edit", $edit, t('Save'));
-    $this->assertRaw(t('test_entity @id has been updated.', array('@id' => $id)));
+    $this->drupalPost("entity_test/manage/$id/edit", $edit, t('Save'));
+    $this->assertText(t('entity_test @id has been updated.', array('@id' => $id)));
 
     $this->renderTestEntity($id);
     $expected_link = l($title, $value);
@@ -229,8 +237,8 @@ function testLinkFormatter() {
     field_create_field($this->field);
     $this->instance = array(
       'field_name' => $this->field['field_name'],
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
       'settings' => array(
         'title' => DRUPAL_OPTIONAL,
       ),
@@ -243,7 +251,7 @@ function testLinkFormatter() {
       'label' => 'hidden',
     );
     field_create_instance($this->instance);
-    entity_get_display('test_entity', 'test_bundle', 'full')
+    entity_get_display('entity_test', 'entity_test', 'full')
       ->setComponent($this->field['field_name'], $display_options)
       ->save();
 
@@ -254,13 +262,15 @@ function testLinkFormatter() {
     // - The second field item uses a URL and title.
     // For consistency in assertion code below, the URL is assigned to the title
     // variable for the first field.
-    $this->drupalGet('test-entity/add/test_bundle');
+    $this->drupalGet('entity_test/add');
     $url1 = 'http://www.example.com/content/articles/archive?author=John&year=2012#com';
     $url2 = 'http://www.example.org/content/articles/archive?author=John&year=2012#org';
     $title1 = $url1;
     // Intentionally contains an ampersand that needs sanitization on output.
     $title2 = 'A very long & strange example title that could break the nice layout of the site';
     $edit = array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
       "{$this->field['field_name']}[$langcode][0][url]" => $url1,
       // Note that $title1 is not submitted.
       "{$this->field['field_name']}[$langcode][0][title]" => '',
@@ -268,9 +278,9 @@ function testLinkFormatter() {
       "{$this->field['field_name']}[$langcode][1][title]" => $title2,
     );
     $this->drupalPost(NULL, $edit, t('Save'));
-    preg_match('|test-entity/manage/(\d+)/edit|', $this->url, $match);
+    preg_match('|entity_test/manage/(\d+)/edit|', $this->url, $match);
     $id = $match[1];
-    $this->assertRaw(t('test_entity @id has been created.', array('@id' => $id)));
+    $this->assertText(t('entity_test @id has been created.', array('@id' => $id)));
 
     // Verify that the link is output according to the formatter settings.
     // Not using generatePermutations(), since that leads to 32 cases, which
@@ -297,7 +307,7 @@ function testLinkFormatter() {
         else {
           $display_options['settings'] = $new_value;
         }
-        entity_get_display('test_entity', 'test_bundle', 'full')
+        entity_get_display('entity_test', 'entity_test', 'full')
           ->setComponent($this->field['field_name'], $display_options)
           ->save();
 
@@ -365,8 +375,8 @@ function testLinkSeparateFormatter() {
     field_create_field($this->field);
     $this->instance = array(
       'field_name' => $this->field['field_name'],
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
       'settings' => array(
         'title' => DRUPAL_OPTIONAL,
       ),
@@ -379,7 +389,7 @@ function testLinkSeparateFormatter() {
       'label' => 'hidden',
     );
     field_create_instance($this->instance);
-    entity_get_display('test_entity', 'test_bundle', 'full')
+    entity_get_display('entity_test', 'entity_test', 'full')
       ->setComponent($this->field['field_name'], $display_options)
       ->save();
 
@@ -390,20 +400,22 @@ function testLinkSeparateFormatter() {
     // - The second field item uses a URL and title.
     // For consistency in assertion code below, the URL is assigned to the title
     // variable for the first field.
-    $this->drupalGet('test-entity/add/test_bundle');
+    $this->drupalGet('entity_test/add');
     $url1 = 'http://www.example.com/content/articles/archive?author=John&year=2012#com';
     $url2 = 'http://www.example.org/content/articles/archive?author=John&year=2012#org';
     // Intentionally contains an ampersand that needs sanitization on output.
     $title2 = 'A very long & strange example title that could break the nice layout of the site';
     $edit = array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
       "{$this->field['field_name']}[$langcode][0][url]" => $url1,
       "{$this->field['field_name']}[$langcode][1][url]" => $url2,
       "{$this->field['field_name']}[$langcode][1][title]" => $title2,
     );
     $this->drupalPost(NULL, $edit, t('Save'));
-    preg_match('|test-entity/manage/(\d+)/edit|', $this->url, $match);
+    preg_match('|entity_test/manage/(\d+)/edit|', $this->url, $match);
     $id = $match[1];
-    $this->assertRaw(t('test_entity @id has been created.', array('@id' => $id)));
+    $this->assertText(t('entity_test @id has been created.', array('@id' => $id)));
 
     // Verify that the link is output according to the formatter settings.
     $options = array(
@@ -415,7 +427,7 @@ function testLinkSeparateFormatter() {
       foreach ($values as $new_value) {
         // Update the field formatter settings.
         $display_options['settings'] = array($setting => $new_value);
-        entity_get_display('test_entity', 'test_bundle', 'full')
+        entity_get_display('entity_test', 'entity_test', 'full')
           ->setComponent($this->field['field_name'], $display_options)
           ->save();
 
@@ -468,11 +480,11 @@ function testLinkSeparateFormatter() {
    */
   protected function renderTestEntity($id, $view_mode = 'full', $reset = TRUE) {
     if ($reset) {
-      $this->container->get('plugin.manager.entity')->getStorageController('test_entity')->resetCache(array($id));
+      $this->container->get('plugin.manager.entity')->getStorageController('entity_test')->resetCache(array($id));
     }
-    $entity = field_test_entity_test_load($id);
+    $entity = entity_load('entity_test', $id);
     $display = entity_get_display($entity->entityType(), $entity->bundle(), $view_mode);
-    field_attach_prepare_view('test_entity', array($entity->id() => $entity), array($entity->bundle() => $display));
+    field_attach_prepare_view('entity_test', array($entity->id() => $entity), array($entity->bundle() => $display));
     $entity->content = field_attach_view($entity, $display);
 
     $output = drupal_render($entity->content);
diff --git a/core/modules/number/lib/Drupal/number/Tests/NumberFieldTest.php b/core/modules/number/lib/Drupal/number/Tests/NumberFieldTest.php
index 925828c..9ee7a0f 100644
--- a/core/modules/number/lib/Drupal/number/Tests/NumberFieldTest.php
+++ b/core/modules/number/lib/Drupal/number/Tests/NumberFieldTest.php
@@ -19,7 +19,7 @@ class NumberFieldTest extends WebTestBase {
    *
    * @var array
    */
-  public static $modules = array('node', 'field_test', 'number', 'field_ui');
+  public static $modules = array('node', 'entity_test', 'number', 'field_ui');
 
   protected $field;
   protected $instance;
@@ -36,7 +36,7 @@ public static function getInfo() {
   function setUp() {
     parent::setUp();
 
-    $this->web_user = $this->drupalCreateUser(array('access field_test content', 'administer field_test content', 'administer content types', 'administer node fields','administer node display'));
+    $this->web_user = $this->drupalCreateUser(array('view test entity', 'administer entity_test content', 'administer content types', 'administer node fields','administer node display'));
     $this->drupalLogin($this->web_user);
   }
 
@@ -55,8 +55,8 @@ function testNumberDecimalField() {
     field_create_field($this->field);
     $this->instance = array(
       'field_name' => $this->field['field_name'],
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
       'widget' => array(
         'type' => 'number',
         'settings' => array(
@@ -70,12 +70,12 @@ function testNumberDecimalField() {
       ),
     );
     field_create_instance($this->instance);
-    entity_get_display('test_entity', 'test_bundle', 'default')
+    entity_get_display('entity_test', 'entity_test', 'default')
       ->setComponent($this->field['field_name'])
       ->save();
 
     // Display creation form.
-    $this->drupalGet('test-entity/add/test_bundle');
+    $this->drupalGet('entity_test/add');
     $langcode = LANGUAGE_NOT_SPECIFIED;
     $this->assertFieldByName("{$this->field['field_name']}[$langcode][0][value]", '', 'Widget is displayed');
     $this->assertRaw('placeholder="0.00"');
@@ -83,12 +83,14 @@ function testNumberDecimalField() {
     // Submit a signed decimal value within the allowed precision and scale.
     $value = '-1234.5678';
     $edit = array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
       "{$this->field['field_name']}[$langcode][0][value]" => $value,
     );
     $this->drupalPost(NULL, $edit, t('Save'));
-    preg_match('|test-entity/manage/(\d+)/edit|', $this->url, $match);
+    preg_match('|entity_test/manage/(\d+)/edit|', $this->url, $match);
     $id = $match[1];
-    $this->assertRaw(t('test_entity @id has been created.', array('@id' => $id)), 'Entity was created');
+    $this->assertText(t('entity_test @id has been created.', array('@id' => $id)), 'Entity was created');
     $this->assertRaw(round($value, 2), 'Value is displayed.');
 
     // Try to create entries with more than one decimal separator; assert fail.
@@ -101,7 +103,7 @@ function testNumberDecimalField() {
     );
 
     foreach ($wrong_entries as $wrong_entry) {
-      $this->drupalGet('test-entity/add/test_bundle');
+      $this->drupalGet('entity_test/add');
       $edit = array(
         "{$this->field['field_name']}[$langcode][0][value]" => $wrong_entry,
       );
@@ -119,7 +121,7 @@ function testNumberDecimalField() {
     );
 
     foreach ($wrong_entries as $wrong_entry) {
-      $this->drupalGet('test-entity/add/test_bundle');
+      $this->drupalGet('entity_test/add');
       $edit = array(
         "{$this->field['field_name']}[$langcode][0][value]" => $wrong_entry,
       );
diff --git a/core/modules/options/lib/Drupal/options/Tests/OptionsDynamicValuesTest.php b/core/modules/options/lib/Drupal/options/Tests/OptionsDynamicValuesTest.php
index 4065b7d..34da251 100644
--- a/core/modules/options/lib/Drupal/options/Tests/OptionsDynamicValuesTest.php
+++ b/core/modules/options/lib/Drupal/options/Tests/OptionsDynamicValuesTest.php
@@ -19,7 +19,14 @@ class OptionsDynamicValuesTest extends FieldTestBase {
    *
    * @var array
    */
-  public static $modules = array('options', 'field_test', 'options_test');
+  public static $modules = array('options', 'entity_test', 'options_test');
+
+  /**
+   * The created entity.
+   *
+   * @var \Drupal\Core\Entity\Entity
+   */
+  protected $entity;
 
   function setUp() {
     parent::setUp();
@@ -37,22 +44,28 @@ function setUp() {
 
     $this->instance = array(
       'field_name' => $this->field_name,
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test_rev',
+      'bundle' => 'entity_test_rev',
       'required' => TRUE,
       'widget' => array(
         'type' => 'options_select',
       ),
     );
     $this->instance = field_create_instance($this->instance);
+    // Create an entity and prepare test data that will be used by
+    // options_test_dynamic_values_callback().
+    $values = array(
+      'user_id' => mt_rand(1, 10),
+      'name' => $this->randomName(),
+    );
+    $this->entity = entity_create('entity_test_rev', $values);
+    $this->entity->save();
+    $uri = $this->entity->uri();
     $this->test = array(
-      'id' => mt_rand(1, 10),
-      // Make sure this does not equal the ID so that
-      // options_test_dynamic_values_callback() always returns 4 values.
-      'vid' => mt_rand(20, 30),
-      'bundle' => 'test_bundle',
-      'label' => $this->randomName(),
+      'label' => $this->entity->label(),
+      'uuid' => $this->entity->uuid(),
+      'bundle' => $this->entity->bundle(),
+      'uri' => $uri['path'],
     );
-    $this->entity = call_user_func_array('field_test_create_entity', $this->test);
   }
 }
diff --git a/core/modules/options/lib/Drupal/options/Tests/OptionsDynamicValuesValidationTest.php b/core/modules/options/lib/Drupal/options/Tests/OptionsDynamicValuesValidationTest.php
index 693605a..374be4e 100644
--- a/core/modules/options/lib/Drupal/options/Tests/OptionsDynamicValuesValidationTest.php
+++ b/core/modules/options/lib/Drupal/options/Tests/OptionsDynamicValuesValidationTest.php
@@ -27,9 +27,9 @@ public static function getInfo() {
   function testDynamicAllowedValues() {
     // Verify that the test passes against every value we had.
     foreach ($this->test as $key => $value) {
-      $this->entity->test_options[LANGUAGE_NOT_SPECIFIED][0]['value'] = $value;
+      $this->entity->test_options->value = $value;
       try {
-        field_attach_validate($this->entity);
+        field_attach_validate($this->entity->getBCEntity());
         $this->pass("$key should pass");
       }
       catch (FieldValidationException $e) {
@@ -39,10 +39,10 @@ function testDynamicAllowedValues() {
     }
     // Now verify that the test does not pass against anything else.
     foreach ($this->test as $key => $value) {
-      $this->entity->test_options[LANGUAGE_NOT_SPECIFIED][0]['value'] = is_numeric($value) ? (100 - $value) : ('X' . $value);
+      $this->entity->test_options->value = is_numeric($value) ? (100 - $value) : ('X' . $value);
       $pass = FALSE;
       try {
-        field_attach_validate($this->entity);
+        field_attach_validate($this->entity->getBCEntity());
       }
       catch (FieldValidationException $e) {
         $pass = TRUE;
diff --git a/core/modules/options/lib/Drupal/options/Tests/OptionsSelectDynamicValuesTest.php b/core/modules/options/lib/Drupal/options/Tests/OptionsSelectDynamicValuesTest.php
index 4344d21..0237546 100644
--- a/core/modules/options/lib/Drupal/options/Tests/OptionsSelectDynamicValuesTest.php
+++ b/core/modules/options/lib/Drupal/options/Tests/OptionsSelectDynamicValuesTest.php
@@ -27,11 +27,11 @@ function testSelectListDynamic() {
     $this->entity->save();
 
     // Create a web user.
-    $web_user = $this->drupalCreateUser(array('access field_test content', 'administer field_test content'));
+    $web_user = $this->drupalCreateUser(array('view test entity', 'administer entity_test content'));
     $this->drupalLogin($web_user);
 
     // Display form.
-    $this->drupalGet('test-entity/manage/' . $this->entity->ftid . '/edit');
+    $this->drupalGet('entity_test_rev/manage/' . $this->entity->id() . '/edit');
     $options = $this->xpath('//select[@id="edit-test-options-und"]/option');
     $this->assertEqual(count($options), count($this->test) + 1);
     foreach ($options as $option) {
diff --git a/core/modules/options/lib/Drupal/options/Tests/OptionsWidgetsTest.php b/core/modules/options/lib/Drupal/options/Tests/OptionsWidgetsTest.php
index 023f012..d07626a 100644
--- a/core/modules/options/lib/Drupal/options/Tests/OptionsWidgetsTest.php
+++ b/core/modules/options/lib/Drupal/options/Tests/OptionsWidgetsTest.php
@@ -19,7 +19,7 @@ class OptionsWidgetsTest extends FieldTestBase {
    *
    * @var array
    */
-  public static $modules = array('options', 'field_test', 'options_test', 'taxonomy', 'field_ui');
+  public static $modules = array('options', 'entity_test', 'options_test', 'taxonomy', 'field_ui');
 
   public static function getInfo() {
     return array(
@@ -69,7 +69,7 @@ function setUp() {
     $this->bool = field_create_field($this->bool);
 
     // Create a web user.
-    $this->web_user = $this->drupalCreateUser(array('access field_test content', 'administer field_test content'));
+    $this->web_user = $this->drupalCreateUser(array('view test entity', 'administer entity_test content'));
     $this->drupalLogin($this->web_user);
   }
 
@@ -80,8 +80,8 @@ function testRadioButtons() {
     // Create an instance of the 'single value' field.
     $instance = array(
       'field_name' => $this->card_1['field_name'],
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
       'widget' => array(
         'type' => 'options_buttons',
       ),
@@ -90,13 +90,15 @@ function testRadioButtons() {
     $langcode = LANGUAGE_NOT_SPECIFIED;
 
     // Create an entity.
-    $entity_init = field_test_create_entity();
-    $entity = clone $entity_init;
-    $entity->is_new = TRUE;
-    field_test_entity_save($entity);
+    $entity = entity_create('entity_test', array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
+    ));
+    $entity->save();
+    $entity_init = clone $entity;
 
     // With no field data, no buttons are checked.
-    $this->drupalGet('test-entity/manage/' . $entity->ftid . '/edit');
+    $this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
     $this->assertNoFieldChecked("edit-card-1-$langcode-0");
     $this->assertNoFieldChecked("edit-card-1-$langcode-1");
     $this->assertNoFieldChecked("edit-card-1-$langcode-2");
@@ -108,7 +110,7 @@ function testRadioButtons() {
     $this->assertFieldValues($entity_init, 'card_1', $langcode, array(0));
 
     // Check that the selected button is checked.
-    $this->drupalGet('test-entity/manage/' . $entity->ftid . '/edit');
+    $this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
     $this->assertFieldChecked("edit-card-1-$langcode-0");
     $this->assertNoFieldChecked("edit-card-1-$langcode-1");
     $this->assertNoFieldChecked("edit-card-1-$langcode-2");
@@ -123,7 +125,7 @@ function testRadioButtons() {
     field_update_field($this->card_1);
     $instance['required'] = TRUE;
     field_update_instance($instance);
-    $this->drupalGet('test-entity/manage/' . $entity->ftid . '/edit');
+    $this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
     $this->assertFieldChecked("edit-card-1-$langcode-99");
   }
 
@@ -134,8 +136,8 @@ function testCheckBoxes() {
     // Create an instance of the 'multiple values' field.
     $instance = array(
       'field_name' => $this->card_2['field_name'],
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
       'widget' => array(
         'type' => 'options_buttons',
       ),
@@ -144,13 +146,15 @@ function testCheckBoxes() {
     $langcode = LANGUAGE_NOT_SPECIFIED;
 
     // Create an entity.
-    $entity_init = field_test_create_entity();
-    $entity = clone $entity_init;
-    $entity->is_new = TRUE;
-    field_test_entity_save($entity);
+    $entity = entity_create('entity_test', array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
+    ));
+    $entity->save();
+    $entity_init = clone $entity;
 
     // Display form: with no field data, nothing is checked.
-    $this->drupalGet('test-entity/manage/' . $entity->ftid . '/edit');
+    $this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
     $this->assertNoFieldChecked("edit-card-2-$langcode-0");
     $this->assertNoFieldChecked("edit-card-2-$langcode-1");
     $this->assertNoFieldChecked("edit-card-2-$langcode-2");
@@ -166,7 +170,7 @@ function testCheckBoxes() {
     $this->assertFieldValues($entity_init, 'card_2', $langcode, array(0, 2));
 
     // Display form: check that the right options are selected.
-    $this->drupalGet('test-entity/manage/' . $entity->ftid . '/edit');
+    $this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
     $this->assertFieldChecked("edit-card-2-$langcode-0");
     $this->assertNoFieldChecked("edit-card-2-$langcode-1");
     $this->assertFieldChecked("edit-card-2-$langcode-2");
@@ -181,7 +185,7 @@ function testCheckBoxes() {
     $this->assertFieldValues($entity_init, 'card_2', $langcode, array(0));
 
     // Display form: check that the right options are selected.
-    $this->drupalGet('test-entity/manage/' . $entity->ftid . '/edit');
+    $this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
     $this->assertFieldChecked("edit-card-2-$langcode-0");
     $this->assertNoFieldChecked("edit-card-2-$langcode-1");
     $this->assertNoFieldChecked("edit-card-2-$langcode-2");
@@ -210,7 +214,7 @@ function testCheckBoxes() {
     field_update_field($this->card_2);
     $instance['required'] = TRUE;
     field_update_instance($instance);
-    $this->drupalGet('test-entity/manage/' . $entity->ftid . '/edit');
+    $this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
     $this->assertFieldChecked("edit-card-2-$langcode-99");
   }
 
@@ -221,8 +225,8 @@ function testSelectListSingle() {
     // Create an instance of the 'single value' field.
     $instance = array(
       'field_name' => $this->card_1['field_name'],
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
       'required' => TRUE,
       'widget' => array(
         'type' => 'options_select',
@@ -232,13 +236,15 @@ function testSelectListSingle() {
     $langcode = LANGUAGE_NOT_SPECIFIED;
 
     // Create an entity.
-    $entity_init = field_test_create_entity();
-    $entity = clone $entity_init;
-    $entity->is_new = TRUE;
-    field_test_entity_save($entity);
+    $entity = entity_create('entity_test', array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
+    ));
+    $entity->save();
+    $entity_init = clone $entity;
 
     // Display form.
-    $this->drupalGet('test-entity/manage/' . $entity->ftid . '/edit');
+    $this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
     // A required field without any value has a "none" option.
     $this->assertTrue($this->xpath('//select[@id=:id]//option[@value="_none" and text()=:label]', array(':id' => 'edit-card-1-' . $langcode, ':label' => t('- Select a value -'))), 'A required select list has a "Select a value" choice.');
 
@@ -260,7 +266,7 @@ function testSelectListSingle() {
     $this->assertFieldValues($entity_init, 'card_1', $langcode, array(0));
 
     // Display form: check that the right options are selected.
-    $this->drupalGet('test-entity/manage/' . $entity->ftid . '/edit');
+    $this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
     // A required field with a value has no 'none' option.
     $this->assertFalse($this->xpath('//select[@id=:id]//option[@value="_none"]', array(':id' => 'edit-card-1-' . $langcode)), 'A required select list with an actual value has no "none" choice.');
     $this->assertOptionSelected("edit-card-1-$langcode", 0);
@@ -272,12 +278,12 @@ function testSelectListSingle() {
     field_update_instance($instance);
 
     // Display form.
-    $this->drupalGet('test-entity/manage/' . $entity->ftid . '/edit');
+    $this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
     // A non-required field has a 'none' option.
     $this->assertTrue($this->xpath('//select[@id=:id]//option[@value="_none" and text()=:label]', array(':id' => 'edit-card-1-' . $langcode, ':label' => t('- None -'))), 'A non-required select list has a "None" choice.');
     // Submit form: Unselect the option.
     $edit = array("card_1[$langcode]" => '_none');
-    $this->drupalPost('test-entity/manage/' . $entity->ftid . '/edit', $edit, t('Save'));
+    $this->drupalPost('entity_test/manage/' . $entity->id() . '/edit', $edit, t('Save'));
     $this->assertFieldValues($entity_init, 'card_1', $langcode, array());
 
     // Test optgroups.
@@ -287,7 +293,7 @@ function testSelectListSingle() {
     field_update_field($this->card_1);
 
     // Display form: with no field data, nothing is selected
-    $this->drupalGet('test-entity/manage/' . $entity->ftid . '/edit');
+    $this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
     $this->assertNoOptionSelected("edit-card-1-$langcode", 0);
     $this->assertNoOptionSelected("edit-card-1-$langcode", 1);
     $this->assertNoOptionSelected("edit-card-1-$langcode", 2);
@@ -300,14 +306,14 @@ function testSelectListSingle() {
     $this->assertFieldValues($entity_init, 'card_1', $langcode, array(0));
 
     // Display form: check that the right options are selected.
-    $this->drupalGet('test-entity/manage/' . $entity->ftid . '/edit');
+    $this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
     $this->assertOptionSelected("edit-card-1-$langcode", 0);
     $this->assertNoOptionSelected("edit-card-1-$langcode", 1);
     $this->assertNoOptionSelected("edit-card-1-$langcode", 2);
 
     // Submit form: Unselect the option.
     $edit = array("card_1[$langcode]" => '_none');
-    $this->drupalPost('test-entity/manage/' . $entity->ftid . '/edit', $edit, t('Save'));
+    $this->drupalPost('entity_test/manage/' . $entity->id() . '/edit', $edit, t('Save'));
     $this->assertFieldValues($entity_init, 'card_1', $langcode, array());
   }
 
@@ -318,8 +324,8 @@ function testSelectListMultiple() {
     // Create an instance of the 'multiple values' field.
     $instance = array(
       'field_name' => $this->card_2['field_name'],
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
       'widget' => array(
         'type' => 'options_select',
       ),
@@ -328,13 +334,15 @@ function testSelectListMultiple() {
     $langcode = LANGUAGE_NOT_SPECIFIED;
 
     // Create an entity.
-    $entity_init = field_test_create_entity();
-    $entity = clone $entity_init;
-    $entity->is_new = TRUE;
-    field_test_entity_save($entity);
+    $entity = entity_create('entity_test', array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
+    ));
+    $entity->save();
+    $entity_init = clone $entity;
 
     // Display form: with no field data, nothing is selected.
-    $this->drupalGet('test-entity/manage/' . $entity->ftid . '/edit');
+    $this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
     $this->assertNoOptionSelected("edit-card-2-$langcode", 0);
     $this->assertNoOptionSelected("edit-card-2-$langcode", 1);
     $this->assertNoOptionSelected("edit-card-2-$langcode", 2);
@@ -346,7 +354,7 @@ function testSelectListMultiple() {
     $this->assertFieldValues($entity_init, 'card_2', $langcode, array(0, 2));
 
     // Display form: check that the right options are selected.
-    $this->drupalGet('test-entity/manage/' . $entity->ftid . '/edit');
+    $this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
     $this->assertOptionSelected("edit-card-2-$langcode", 0);
     $this->assertNoOptionSelected("edit-card-2-$langcode", 1);
     $this->assertOptionSelected("edit-card-2-$langcode", 2);
@@ -357,7 +365,7 @@ function testSelectListMultiple() {
     $this->assertFieldValues($entity_init, 'card_2', $langcode, array(0));
 
     // Display form: check that the right options are selected.
-    $this->drupalGet('test-entity/manage/' . $entity->ftid . '/edit');
+    $this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
     $this->assertOptionSelected("edit-card-2-$langcode", 0);
     $this->assertNoOptionSelected("edit-card-2-$langcode", 1);
     $this->assertNoOptionSelected("edit-card-2-$langcode", 2);
@@ -377,18 +385,18 @@ function testSelectListMultiple() {
     // Check that the 'none' option has no efect if actual options are selected
     // as well.
     $edit = array("card_2[$langcode][]" => array('_none' => '_none', 0 => 0));
-    $this->drupalPost('test-entity/manage/' . $entity->ftid . '/edit', $edit, t('Save'));
+    $this->drupalPost('entity_test/manage/' . $entity->id() . '/edit', $edit, t('Save'));
     $this->assertFieldValues($entity_init, 'card_2', $langcode, array(0));
 
     // Check that selecting the 'none' option empties the field.
     $edit = array("card_2[$langcode][]" => array('_none' => '_none'));
-    $this->drupalPost('test-entity/manage/' . $entity->ftid . '/edit', $edit, t('Save'));
+    $this->drupalPost('entity_test/manage/' . $entity->id() . '/edit', $edit, t('Save'));
     $this->assertFieldValues($entity_init, 'card_2', $langcode, array());
 
     // A required select list does not have an empty key.
     $instance['required'] = TRUE;
     field_update_instance($instance);
-    $this->drupalGet('test-entity/manage/' . $entity->ftid . '/edit');
+    $this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
     $this->assertFalse($this->xpath('//select[@id=:id]//option[@value=""]', array(':id' => 'edit-card-2-' . $langcode)), 'A required select list does not have an empty key.');
 
     // We do not have to test that a required select list with one option is
@@ -404,7 +412,7 @@ function testSelectListMultiple() {
     field_update_instance($instance);
 
     // Display form: with no field data, nothing is selected.
-    $this->drupalGet('test-entity/manage/' . $entity->ftid . '/edit');
+    $this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
     $this->assertNoOptionSelected("edit-card-2-$langcode", 0);
     $this->assertNoOptionSelected("edit-card-2-$langcode", 1);
     $this->assertNoOptionSelected("edit-card-2-$langcode", 2);
@@ -417,14 +425,14 @@ function testSelectListMultiple() {
     $this->assertFieldValues($entity_init, 'card_2', $langcode, array(0));
 
     // Display form: check that the right options are selected.
-    $this->drupalGet('test-entity/manage/' . $entity->ftid . '/edit');
+    $this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
     $this->assertOptionSelected("edit-card-2-$langcode", 0);
     $this->assertNoOptionSelected("edit-card-2-$langcode", 1);
     $this->assertNoOptionSelected("edit-card-2-$langcode", 2);
 
     // Submit form: Unselect the option.
     $edit = array("card_2[$langcode][]" => array('_none' => '_none'));
-    $this->drupalPost('test-entity/manage/' . $entity->ftid . '/edit', $edit, t('Save'));
+    $this->drupalPost('entity_test/manage/' . $entity->id() . '/edit', $edit, t('Save'));
     $this->assertFieldValues($entity_init, 'card_2', $langcode, array());
   }
 
@@ -435,8 +443,8 @@ function testOnOffCheckbox() {
     // Create an instance of the 'boolean' field.
     $instance = array(
       'field_name' => $this->bool['field_name'],
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
       'widget' => array(
         'type' => 'options_onoff',
       ),
@@ -445,13 +453,15 @@ function testOnOffCheckbox() {
     $langcode = LANGUAGE_NOT_SPECIFIED;
 
     // Create an entity.
-    $entity_init = field_test_create_entity();
-    $entity = clone $entity_init;
-    $entity->is_new = TRUE;
-    field_test_entity_save($entity);
+    $entity = entity_create('entity_test', array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
+    ));
+    $entity->save();
+    $entity_init = clone $entity;
 
     // Display form: with no field data, option is unchecked.
-    $this->drupalGet('test-entity/manage/' . $entity->ftid . '/edit');
+    $this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
     $this->assertNoFieldChecked("edit-bool-$langcode");
     $this->assertRaw('Some dangerous &amp; unescaped <strong>markup</strong>', 'Option text was properly filtered.');
 
@@ -461,7 +471,7 @@ function testOnOffCheckbox() {
     $this->assertFieldValues($entity_init, 'bool', $langcode, array(0));
 
     // Display form: check that the right options are selected.
-    $this->drupalGet('test-entity/manage/' . $entity->ftid . '/edit');
+    $this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
     $this->assertFieldChecked("edit-bool-$langcode");
 
     // Submit form: uncheck the option.
@@ -470,7 +480,7 @@ function testOnOffCheckbox() {
     $this->assertFieldValues($entity_init, 'bool', $langcode, array(1));
 
     // Display form: with 'off' value, option is unchecked.
-    $this->drupalGet('test-entity/manage/' . $entity->ftid . '/edit');
+    $this->drupalGet('entity_test/manage/' . $entity->id() . '/edit');
     $this->assertNoFieldChecked("edit-bool-$langcode");
 
     // Create Basic page node type.
diff --git a/core/modules/options/tests/options_test.module b/core/modules/options/tests/options_test.module
index 90f6bf1..4ece85c 100644
--- a/core/modules/options/tests/options_test.module
+++ b/core/modules/options/tests/options_test.module
@@ -30,10 +30,11 @@ function options_test_allowed_values_callback($field, $instance, $entity) {
 function options_test_dynamic_values_callback($field, $instance, EntityInterface $entity, &$cacheable) {
   $cacheable = FALSE;
   // We need the values of the entity as keys.
+  $uri = $entity->uri();
   return drupal_map_assoc(array(
-    $entity->ftlabel,
-    $entity->id(),
-    $entity->getRevisionId(),
+    $entity->label(),
+    $uri['path'],
+    $entity->uuid(),
     $entity->bundle(),
   ));
 }
diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/CrudTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/CrudTest.php
index 3383f94..0b5c29a 100644
--- a/core/modules/rdf/lib/Drupal/rdf/Tests/CrudTest.php
+++ b/core/modules/rdf/lib/Drupal/rdf/Tests/CrudTest.php
@@ -34,7 +34,7 @@ public static function getInfo() {
    */
   function testCRUD() {
     // Verify loading of a default mapping.
-    $mapping = _rdf_mapping_load('test_entity', 'test_bundle');
+    $mapping = _rdf_mapping_load('entity_test', 'entity_test');
     $this->assertTrue(count($mapping), 'Default mapping was found.');
 
     // Verify saving a mapping.
diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/MappingHookTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/MappingHookTest.php
index eb1340e..b05f4af 100644
--- a/core/modules/rdf/lib/Drupal/rdf/Tests/MappingHookTest.php
+++ b/core/modules/rdf/lib/Drupal/rdf/Tests/MappingHookTest.php
@@ -19,7 +19,7 @@ class MappingHookTest extends WebTestBase {
    *
    * @var array
    */
-  public static $modules = array('rdf', 'rdf_test', 'field_test');
+  public static $modules = array('rdf', 'rdf_test', 'entity_test');
 
   public static function getInfo() {
     return array(
@@ -34,7 +34,7 @@ public static function getInfo() {
    */
   function testMapping() {
     // Test that the mapping is returned correctly by the hook.
-    $mapping = rdf_mapping_load('test_entity', 'test_bundle');
+    $mapping = rdf_mapping_load('entity_test', 'entity_test');
     $this->assertIdentical($mapping['rdftype'], array('sioc:Post'), 'Mapping for rdftype is sioc:Post.');
     $this->assertIdentical($mapping['title'], array('predicates' => array('dc:title')), 'Mapping for title is dc:title.');
     $this->assertIdentical($mapping['created'], array(
@@ -44,7 +44,7 @@ function testMapping() {
     ), 'Mapping for created is dc:created with datatype xsd:dateTime and callback date_iso8601.');
     $this->assertIdentical($mapping['uid'], array('predicates' => array('sioc:has_creator', 'dc:creator'), 'type' => 'rel'), 'Mapping for uid is sioc:has_creator and dc:creator, and type is rel.');
 
-    $mapping = rdf_mapping_load('test_entity', 'test_bundle_no_mapping');
+    $mapping = rdf_mapping_load('entity_test', 'test_bundle_no_mapping');
     $this->assertEqual($mapping, array(), 'Empty array returned when an entity type, bundle pair has no mapping.');
   }
 }
diff --git a/core/modules/rdf/lib/Drupal/rdf/Tests/RdfaMarkupTest.php b/core/modules/rdf/lib/Drupal/rdf/Tests/RdfaMarkupTest.php
index 6f99dae..2fff526 100644
--- a/core/modules/rdf/lib/Drupal/rdf/Tests/RdfaMarkupTest.php
+++ b/core/modules/rdf/lib/Drupal/rdf/Tests/RdfaMarkupTest.php
@@ -19,7 +19,7 @@ class RdfaMarkupTest extends WebTestBase {
    *
    * @var array
    */
-  public static $modules = array('rdf', 'field_test', 'rdf_test');
+  public static $modules = array('rdf', 'entity_test', 'rdf_test');
 
   protected $profile = 'standard';
 
@@ -39,7 +39,7 @@ function testDrupalRdfaAttributes() {
     $expected_attributes = array(
       'property' => array('dc:title'),
     );
-    $mapping = rdf_mapping_load('test_entity', 'test_bundle');
+    $mapping = rdf_mapping_load('entity_test', 'entity_test');
     $attributes = rdf_rdfa_attributes($mapping['title']);
     ksort($expected_attributes);
     ksort($attributes);
@@ -53,7 +53,7 @@ function testDrupalRdfaAttributes() {
       'property' => array('dc:created'),
       'content' => $isoDate,
     );
-    $mapping = rdf_mapping_load('test_entity', 'test_bundle');
+    $mapping = rdf_mapping_load('entity_test', 'entity_test');
     $attributes = rdf_rdfa_attributes($mapping['created'], $date);
     ksort($expected_attributes);
     ksort($attributes);
@@ -64,7 +64,7 @@ function testDrupalRdfaAttributes() {
       'datatype' => 'foo:bar1type',
       'property' => array('foo:bar1'),
     );
-    $mapping = rdf_mapping_load('test_entity', 'test_bundle');
+    $mapping = rdf_mapping_load('entity_test', 'entity_test');
     $attributes = rdf_rdfa_attributes($mapping['foobar1']);
     ksort($expected_attributes);
     ksort($attributes);
@@ -74,7 +74,7 @@ function testDrupalRdfaAttributes() {
     $expected_attributes = array(
       'rel' => array('sioc:has_creator', 'dc:creator'),
     );
-    $mapping = rdf_mapping_load('test_entity', 'test_bundle');
+    $mapping = rdf_mapping_load('entity_test', 'entity_test');
     $attributes = rdf_rdfa_attributes($mapping['foobar_objproperty1']);
     ksort($expected_attributes);
     ksort($attributes);
@@ -84,7 +84,7 @@ function testDrupalRdfaAttributes() {
     $expected_attributes = array(
       'rev' => array('sioc:reply_of'),
     );
-    $mapping = rdf_mapping_load('test_entity', 'test_bundle');
+    $mapping = rdf_mapping_load('entity_test', 'entity_test');
     $attributes = rdf_rdfa_attributes($mapping['foobar_objproperty2']);
     ksort($expected_attributes);
     ksort($attributes);
diff --git a/core/modules/rdf/tests/rdf_test.module b/core/modules/rdf/tests/rdf_test.module
index 4d90472..ea45e43 100644
--- a/core/modules/rdf/tests/rdf_test.module
+++ b/core/modules/rdf/tests/rdf_test.module
@@ -11,8 +11,8 @@
 function rdf_test_rdf_mapping() {
   return array(
     array(
-      'type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'type' => 'entity_test',
+      'bundle' => 'entity_test',
       'mapping' => array(
         'rdftype' => array('sioc:Post'),
         'title' => array(
diff --git a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryTest.php b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryTest.php
index ae51625..453b309 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Entity/EntityQueryTest.php
@@ -7,6 +7,8 @@
 
 namespace Drupal\system\Tests\Entity;
 
+use Drupal\Core\Language\Language;
+
 /**
  * Tests the basic Entity API.
  */
@@ -17,7 +19,7 @@ class EntityQueryTest extends EntityUnitTestBase {
    *
    * @var array
    */
-  public static $modules = array('field_test');
+  public static $modules = array('field_test', 'language');
 
   /**
    * @var array
@@ -53,7 +55,9 @@ public static function getInfo() {
 
   function setUp() {
     parent::setUp();
-    $this->installSchema('field_test', array('test_entity', 'test_entity_revision', 'test_entity_bundle'));
+    $this->installSchema('entity_test', array('entity_test_rev', 'entity_test_rev_revision'));
+    $this->installSchema('language', array('language'));
+    $this->installSchema('system', array('variable'));
     $figures = drupal_strtolower($this->randomName());
     $greetings = drupal_strtolower($this->randomName());
     foreach (array($figures => 'shape', $greetings => 'text') as $field_name => $field_type) {
@@ -71,11 +75,11 @@ function setUp() {
       do {
         $bundle = $this->randomName();
       } while ($bundles && strtolower($bundles[0]) >= strtolower($bundle));
-      field_test_create_bundle($bundle);
+      entity_test_create_bundle($bundle);
       foreach ($fields as $field) {
         $instance = array(
           'field_name' => $field['field_name'],
-          'entity_type' => 'test_entity',
+          'entity_type' => 'entity_test_rev',
           'bundle' => $bundle,
         );
         field_create_instance($instance);
@@ -102,24 +106,34 @@ function setUp() {
       'format' => 'format-pl'
     ));
     // Make these languages available to the greetings field.
+    $language = new Language(array(
+      'langcode' => 'tr',
+      'name' => $this->randomString(),
+    ));
+    language_save($language);
+    $language = new Language(array(
+      'langcode' => 'pl',
+      'name' => $this->randomString(),
+    ));
+    language_save($language);
     $field_langcodes = &drupal_static('field_available_languages');
-    $field_langcodes['test_entity'][$greetings] = array('tr', 'pl');
+    $field_langcodes['entity_test_rev'][$greetings] = array('tr', 'pl');
     // Calculate the cartesian product of the unit array by looking at the
     // bits of $i and add the unit at the bits that are 1. For example,
     // decimal 13 is binary 1101 so unit 3,2 and 0 will be added to the
     // entity.
     for ($i = 1; $i <= 15; $i++) {
-      $entity = entity_create('test_entity', array(
-        'ftid' => $i,
-        'ftvid' => $i,
-        'fttype' => $bundles[$i & 1],
+      $entity = entity_create('entity_test_rev', array(
+        'id' => $i,
+        'revision_id' => $i,
+        'type' => $bundles[$i & 1],
       ));
       $entity->enforceIsNew();
       $entity->setNewRevision();
       foreach (array_reverse(str_split(decbin($i))) as $key => $bit) {
         if ($bit) {
           $unit = $units[$key];
-          $entity->{$unit[0]}[$unit[1]][] = $unit[2];
+          $entity->getTranslation($unit[1])->{$unit[0]}->setValue($unit[2]);
         }
       }
       $entity->save();
@@ -135,19 +149,19 @@ function setUp() {
   function testEntityQuery() {
     $greetings = $this->greetings;
     $figures = $this->figures;
-    $this->queryResults = $this->factory->get('test_entity')
+    $this->queryResults = $this->factory->get('entity_test_rev')
       ->exists($greetings, 'tr')
       ->condition("$figures.color", 'red')
-      ->sort('ftid')
+      ->sort('id')
       ->execute();
     // As unit 0 was the red triangle and unit 2 was the turkish greeting,
     // bit 0 and bit 2 needs to be set.
     $this->assertResult(5, 7, 13, 15);
 
-    $query = $this->factory->get('test_entity', 'OR')
+    $query = $this->factory->get('entity_test_rev', 'OR')
       ->exists($greetings, 'tr')
       ->condition("$figures.color", 'red')
-      ->sort('ftid');
+      ->sort('id');
     $count_query = clone $query;
     $this->assertEqual(12, $count_query->count()->execute());
     $this->queryResults = $query->execute();
@@ -156,9 +170,9 @@ function testEntityQuery() {
     $this->assertResult(1, 3, 4, 5, 6, 7, 9, 11, 12, 13, 14, 15);
 
     // Test cloning of query conditions.
-    $query = $this->factory->get('test_entity')
+    $query = $this->factory->get('entity_test_rev')
       ->condition("$figures.color", 'red')
-      ->sort('ftid');
+      ->sort('id');
     $cloned_query = clone $query;
     $cloned_query
       ->condition("$figures.shape", 'circle');
@@ -169,95 +183,95 @@ function testEntityQuery() {
     $this->queryResults = $cloned_query->execute();
     $this->assertResult();
 
-    $query = $this->factory->get('test_entity');
+    $query = $this->factory->get('entity_test_rev');
     $group = $query->orConditionGroup()
       ->exists($greetings, 'tr')
       ->condition("$figures.color", 'red');
     $this->queryResults = $query
       ->condition($group)
       ->condition("$greetings.value", 'sie', 'STARTS_WITH')
-      ->sort('ftvid')
+      ->sort('revision_id')
       ->execute();
     // Bit 3 and (bit 0 or 2) -- the above 8 part of the above.
     $this->assertResult(9, 11, 12, 13, 14, 15);
 
     // No figure has both the colors blue and red at the same time.
-    $this->queryResults = $this->factory->get('test_entity')
+    $this->queryResults = $this->factory->get('entity_test_rev')
       ->condition("$figures.color", 'blue')
       ->condition("$figures.color", 'red')
-      ->sort('ftid')
+      ->sort('id')
       ->execute();
     $this->assertResult();
 
     // But an entity might have a red and a blue figure both.
-    $query = $this->factory->get('test_entity');
+    $query = $this->factory->get('entity_test_rev');
     $group_blue = $query->andConditionGroup()->condition("$figures.color", 'blue');
     $group_red = $query->andConditionGroup()->condition("$figures.color", 'red');
     $this->queryResults = $query
       ->condition($group_blue)
       ->condition($group_red)
-      ->sort('ftvid')
+      ->sort('revision_id')
       ->execute();
     // Unit 0 and unit 1, so bits 0 1.
     $this->assertResult(3, 7, 11, 15);
 
-    $this->queryResults = $this->factory->get('test_entity')
+    $this->queryResults = $this->factory->get('entity_test_rev')
       ->exists("$figures.color")
       ->notExists("$greetings.value")
-      ->sort('ftid')
+      ->sort('id')
       ->execute();
     // Bit 0 or 1 is on but 2 and 3 are not.
     $this->assertResult(1, 2, 3);
     // Now update the 'merhaba' string to xsiemax which is not a meaningful
     // word but allows us to test revisions and string operations.
-    $ids = $this->factory->get('test_entity')
+    $ids = $this->factory->get('entity_test_rev')
       ->condition("$greetings.value", 'merhaba')
       ->execute();
-    $entities = entity_load_multiple('test_entity', $ids);
+    $entities = entity_load_multiple('entity_test_rev', $ids);
     foreach ($entities as $entity) {
       $entity->setNewRevision();
-      $entity->{$greetings}['tr'][0]['value'] = 'xsiemax';
+      $entity->getTranslation('tr')->$greetings->value = 'xsiemax';
       $entity->save();
     }
     // When querying current revisions, this string is no longer found.
-    $this->queryResults = $this->factory->get('test_entity')
+    $this->queryResults = $this->factory->get('entity_test_rev')
       ->condition("$greetings.value", 'merhaba')
       ->execute();
     $this->assertResult();
-    $this->queryResults = $this->factory->get('test_entity')
+    $this->queryResults = $this->factory->get('entity_test_rev')
       ->condition("$greetings.value", 'merhaba')
       ->age(FIELD_LOAD_REVISION)
-      ->sort('ftvid')
+      ->sort('revision_id')
       ->execute();
     // Bit 2 needs to be set.
     // The keys must be 16-23 because the first batch stopped at 15 so the
     // second started at 16 and eight entities were saved.
     $assert = $this->assertRevisionResult(range(16, 23), array(4, 5, 6, 7, 12, 13, 14, 15));
-    $results = $this->factory->get('test_entity')
+    $results = $this->factory->get('entity_test_rev')
       ->condition("$greetings.value", 'siema', 'CONTAINS')
-      ->sort('ftid')
+      ->sort('id')
       ->execute();
     // This is the same as the previous one because xsiemax replaced merhaba
     // but also it contains the entities that siema originally but not
     // merhaba.
     $assert = array_slice($assert, 0, 4, TRUE) + array(8 => '8', 9 => '9', 10 => '10', 11 => '11') + array_slice($assert, 4, 4, TRUE);
     $this->assertIdentical($results, $assert);
-    $results = $this->factory->get('test_entity')
+    $results = $this->factory->get('entity_test_rev')
       ->condition("$greetings.value", 'siema', 'STARTS_WITH')
       ->execute();
     // Now we only get the ones that originally were siema, entity id 8 and
     // above.
     $this->assertIdentical($results, array_slice($assert, 4, 8, TRUE));
-    $results = $this->factory->get('test_entity')
+    $results = $this->factory->get('entity_test_rev')
       ->condition("$greetings.value", 'a', 'ENDS_WITH')
       ->execute();
     // It is very important that we do not get the ones which only have
     // xsiemax despite originally they were merhaba, ie. ended with a.
     $this->assertIdentical($results, array_slice($assert, 4, 8, TRUE));
-    $results = $this->factory->get('test_entity')
+    $results = $this->factory->get('entity_test_rev')
       ->condition("$greetings.value", 'a', 'ENDS_WITH')
       ->age(FIELD_LOAD_REVISION)
-      ->sort('ftid')
+      ->sort('id')
       ->execute();
     // Now we get everything.
     $this->assertIdentical($results, $assert);
@@ -272,18 +286,18 @@ function testSort() {
     $greetings = $this->greetings;
     $figures = $this->figures;
     // Order up and down on a number.
-    $this->queryResults = $this->factory->get('test_entity')
-      ->sort('ftid')
+    $this->queryResults = $this->factory->get('entity_test_rev')
+      ->sort('id')
       ->execute();
     $this->assertResult(range(1, 15));
-    $this->queryResults = $this->factory->get('test_entity')
-      ->sort('ftid', 'DESC')
+    $this->queryResults = $this->factory->get('entity_test_rev')
+      ->sort('id', 'DESC')
       ->execute();
     $this->assertResult(range(15, 1));
-    $query = $this->factory->get('test_entity')
+    $query = $this->factory->get('entity_test_rev')
       ->sort("$figures.color")
       ->sort("$greetings.format")
-      ->sort('ftid');
+      ->sort('id');
     // As we do not have any conditions, here are the possible colors and
     // language codes, already in order, with the first occurence of the
     // entity id marked with *:
@@ -326,19 +340,19 @@ function testSort() {
     // Test the pager by setting element #1 to page 2 with a page size of 4.
     // Results will be #8-12 from above.
     $_GET['page'] = '0,2';
-    $this->queryResults = $this->factory->get('test_entity')
+    $this->queryResults = $this->factory->get('entity_test_rev')
       ->sort("$figures.color")
       ->sort("$greetings.format")
-      ->sort('ftid')
+      ->sort('id')
       ->pager(4, 1)
       ->execute();
     $this->assertResult(15, 6, 7, 1);
 
     // Now test the reversed order.
-    $query = $this->factory->get('test_entity')
+    $query = $this->factory->get('entity_test_rev')
       ->sort("$figures.color", 'DESC')
       ->sort("$greetings.format", 'DESC')
-      ->sort('ftid', 'DESC');
+      ->sort('id', 'DESC');
     $count_query = clone $query;
     $this->assertEqual(15, $count_query->count()->execute());
     $this->queryResults = $query->execute();
@@ -355,26 +369,26 @@ protected function testTableSort() {
     $_GET['sort'] = 'asc';
     $_GET['order'] = 'Type';
     $header = array(
-      'id' => array('data' => 'Id', 'specifier' => 'ftid'),
+      'id' => array('data' => 'Id', 'specifier' => 'id'),
       'type' => array('data' => 'Type', 'specifier' => 'fttype'),
     );
 
-    $this->queryResults = array_values($this->factory->get('test_entity')
+    $this->queryResults = array_values($this->factory->get('entity_test_rev')
       ->tableSort($header)
       ->execute());
     $this->assertBundleOrder('asc');
     $_GET['sort'] = 'desc';
     $header = array(
-      'id' => array('data' => 'Id', 'specifier' => 'ftid'),
+      'id' => array('data' => 'Id', 'specifier' => 'id'),
       'type' => array('data' => 'Type', 'specifier' => 'fttype'),
     );
-    $this->queryResults = array_values($this->factory->get('test_entity')
+    $this->queryResults = array_values($this->factory->get('entity_test_rev')
       ->tableSort($header)
       ->execute());
     $this->assertBundleOrder('desc');
     // Ordering on ID is definite, however.
     $_GET['order'] = 'Id';
-    $this->queryResults = $this->factory->get('test_entity')
+    $this->queryResults = $this->factory->get('entity_test_rev')
       ->tableSort($header)
       ->execute();
     $this->assertResult(range(15, 1));
@@ -396,7 +410,7 @@ protected function testCount() {
     field_create_instance($instance);
 
     $entity = entity_create('test_entity_bundle', array(
-      'ftid' => 1,
+      'id' => 1,
       'fttype' => $bundle,
     ));
     $entity->enforceIsNew();
@@ -459,7 +473,7 @@ protected function assertBundleOrder($order) {
    * The tags and metadata should propogate to the SQL query object.
    */
   function testMetaData() {
-    $query = entity_query('test_entity');
+    $query = entity_query('entity_test_rev');
     $query
       ->addTag('efq_metadata_test')
       ->addMetaData('foo', 'bar')
diff --git a/core/modules/system/tests/modules/entity_test/entity_test.install b/core/modules/system/tests/modules/entity_test/entity_test.install
index dacd1f5..c9c33fc 100644
--- a/core/modules/system/tests/modules/entity_test/entity_test.install
+++ b/core/modules/system/tests/modules/entity_test/entity_test.install
@@ -58,6 +58,13 @@ function entity_test_schema() {
         'length' => 128,
         'not null' => FALSE,
       ),
+      'type' => array(
+        'description' => 'The bundle of the test entity.',
+        'type' => 'varchar',
+        'length' => 32,
+        'not null' => TRUE,
+        'default' => '',
+      ),
       'langcode' => array(
         'description' => 'The {language}.langcode of the original variant of this test entity.',
         'type' => 'varchar',
diff --git a/core/modules/system/tests/modules/entity_test/entity_test.module b/core/modules/system/tests/modules/entity_test/entity_test.module
index 9f558b3..421f1c2 100644
--- a/core/modules/system/tests/modules/entity_test/entity_test.module
+++ b/core/modules/system/tests/modules/entity_test/entity_test.module
@@ -64,6 +64,27 @@ function entity_test_entity_info_alter(&$info) {
 }
 
 /**
+ * Implements hook_entity_view_mode_info_alter().
+ */
+function entity_test_entity_view_mode_info_alter(&$view_modes) {
+  $entity_info = entity_get_info();
+  foreach ($entity_info as $entity_type => $info) {
+    if ($entity_info[$entity_type]['module'] == 'entity_test') {
+      $view_modes[$entity_type] = array(
+        'full' => array(
+          'label' => t('Full object'),
+          'custom_settings' => TRUE,
+        ),
+        'teaser' => array(
+          'label' => t('Teaser'),
+          'custom_settings' => TRUE,
+        ),
+      );
+    }
+  }
+}
+
+/**
  * Implements hook_field_extra_fields().
  */
 function entity_test_field_extra_fields() {
@@ -282,3 +303,43 @@ function entity_test_entity_view_mode_info() {
 
   return $view_modes;
 }
+
+/**
+ * Creates a new bundle for entity_test entities.
+ *
+ * @param $bundle
+ *   The machine-readable name of the bundle.
+ * @param $text
+ *   The human-readable name of the bundle. If none is provided, the machine
+ *   name will be used.
+ */
+function entity_test_create_bundle($bundle, $text = NULL, $entity_type = 'entity_test') {
+  $bundles = state()->get($entity_type . '.bundles') ?: array('entity_test' => array('label' => 'Entity Test Bundle'));
+  $bundles += array($bundle => array('label' => $text ? $text : $bundle));
+  state()->set($entity_type . '.bundles', $bundles);
+
+  $info = entity_get_info();
+  foreach ($info as $type => $type_info) {
+    if ($type_info['module'] == 'entity_test') {
+      field_attach_create_bundle($type, $bundle);
+    }
+  }
+}
+
+/**
+ * Implements hook_entity_bundle_info_alter().
+ */
+function entity_test_entity_bundle_info_alter(&$bundles) {
+  $entity_info = entity_get_info();
+  foreach ($bundles as $entity_type => $info) {
+    if ($entity_info[$entity_type]['module'] == 'entity_test') {
+      $bundles[$entity_type] = state()->get($entity_type . '.bundles') ?: array($entity_type => array('label' => 'Entity Test Bundle'));
+      /*if ($entity_type == 'test_entity_bundle') {
+        $bundles[$entity_type] += array('test_entity_2' => array('label' => 'Test entity 2'));
+      }
+      if ($entity_type == 'test_entity_bundle_key') {
+        $bundles[$entity_type] += array('bundle1' => array('label' => 'Bundle1'), 'bundle2' => array('label' => 'Bundle2'));
+      }*/
+    }
+  }
+}
diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestFormController.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestFormController.php
index c08e3b3..f404d13 100644
--- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestFormController.php
+++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestFormController.php
@@ -50,10 +50,35 @@ public function form(array $form, array &$form_state, EntityInterface $entity) {
       '#languages' => LANGUAGE_ALL,
     );
 
+    // @todo: Is there a better way to check if an entity type is revisionable?
+    $entity_info = $entity->entityInfo();
+    if (!empty($entity_info['entity_keys']['revision']) && !$entity->isNew()) {
+      $form['revision'] = array(
+        '#type' => 'checkbox',
+        '#title' => t('Create new revision'),
+        '#default_value' => $entity->isNewRevision(),
+      );
+    }
+
     return $form;
   }
 
   /**
+   * Overrides \Drupal\Core\Entity\EntityFormController::submit().
+   */
+  public function submit(array $form, array &$form_state) {
+    // Build the entity object from the submitted values.
+    $entity = parent::submit($form, $form_state);
+
+    // Save as a new revision if requested to do so.
+    if (!empty($form_state['values']['revision'])) {
+      $entity->setNewRevision();
+    }
+
+    return $entity;
+  }
+
+  /**
    * Overrides Drupal\Core\Entity\EntityFormController::save().
    */
   public function save(array $form, array &$form_state) {
diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestStorageController.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestStorageController.php
index 500a41c..ef81ef2 100644
--- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestStorageController.php
+++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/EntityTestStorageController.php
@@ -17,6 +17,13 @@
  */
 class EntityTestStorageController extends DatabaseStorageControllerNG {
 
+  public function create(array $values) {
+    if (empty($values['type'])) {
+      $values['type'] = 'entity_test';
+    }
+    return parent::create($values);
+  }
+
   /**
    * Implements \Drupal\Core\Entity\DataBaseStorageControllerNG::baseFieldDefinitions().
    */
@@ -43,6 +50,11 @@ public function baseFieldDefinitions() {
       'type' => 'string_field',
       'translatable' => TRUE,
     );
+    $fields['type'] = array(
+      'label' => t('Type'),
+      'description' => t('The bundle of the test entity.'),
+      'type' => 'string_field',
+    );
     $fields['user_id'] = array(
       'label' => t('User ID'),
       'description' => t('The ID of the associated user.'),
diff --git a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Plugin/Core/Entity/EntityTest.php b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Plugin/Core/Entity/EntityTest.php
index 0bfb73e..51d2736 100644
--- a/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Plugin/Core/Entity/EntityTest.php
+++ b/core/modules/system/tests/modules/entity_test/lib/Drupal/entity_test/Plugin/Core/Entity/EntityTest.php
@@ -29,6 +29,7 @@
  *   entity_keys = {
  *     "id" = "id",
  *     "uuid" = "uuid",
+ *     "bundle" = "type",
  *   },
  *   menu_base_path = "entity-test/manage/%entity_test"
  * )
@@ -50,6 +51,15 @@ class EntityTest extends EntityNG {
   public $uuid;
 
   /**
+   * The bundle of the test entity.
+   *
+   * @name: EntityNG already has a bundle property, so we can not use that.
+   *
+   * @var \Drupal\Core\Entity\Field\FieldInterface
+   */
+  public $type;
+
+  /**
    * The name of the test entity.
    *
    * @var \Drupal\Core\Entity\Field\FieldInterface
@@ -73,6 +83,7 @@ protected function init() {
     unset($this->uuid);
     unset($this->name);
     unset($this->user_id);
+    unset($this->type);
   }
 
   /**
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldMultipleVocabularyTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldMultipleVocabularyTest.php
index 8c5571c..86295f9 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldMultipleVocabularyTest.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldMultipleVocabularyTest.php
@@ -17,7 +17,7 @@ class TermFieldMultipleVocabularyTest extends TaxonomyTestBase {
    *
    * @var array
    */
-  public static $modules = array('field_test');
+  public static $modules = array('entity_test');
 
   protected $instance;
   protected $vocabulary1;
@@ -34,7 +34,7 @@ public static function getInfo() {
   function setUp() {
     parent::setUp();
 
-    $web_user = $this->drupalCreateUser(array('access field_test content', 'administer field_test content', 'administer taxonomy'));
+    $web_user = $this->drupalCreateUser(array('view test entity', 'administer entity_test content', 'administer taxonomy'));
     $this->drupalLogin($web_user);
     $this->vocabulary1 = $this->createVocabulary();
     $this->vocabulary2 = $this->createVocabulary();
@@ -61,14 +61,14 @@ function setUp() {
     field_create_field($this->field);
     $this->instance = array(
       'field_name' => $this->field_name,
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
       'widget' => array(
         'type' => 'options_select',
       ),
     );
     field_create_instance($this->instance);
-    entity_get_display('test_entity', 'test_bundle', 'full')
+    entity_get_display('entity_test', 'entity_test', 'full')
       ->setComponent($this->field_name, array(
         'type' => 'taxonomy_term_reference_link',
       ))
@@ -85,21 +85,23 @@ function testTaxonomyTermFieldMultipleVocabularies() {
 
     // Submit an entity with both terms.
     $langcode = LANGUAGE_NOT_SPECIFIED;
-    $this->drupalGet('test-entity/add/test_bundle');
+    $this->drupalGet('entity_test/add');
     $this->assertFieldByName("{$this->field_name}[$langcode][]", '', 'Widget is displayed');
     $edit = array(
+      'user_id' => mt_rand(0, 10),
+      'name' => $this->randomName(),
       "{$this->field_name}[$langcode][]" => array($term1->tid, $term2->tid),
     );
     $this->drupalPost(NULL, $edit, t('Save'));
-    preg_match('|test-entity/manage/(\d+)/edit|', $this->url, $match);
+    preg_match('|entity_test/manage/(\d+)/edit|', $this->url, $match);
     $id = $match[1];
-    $this->assertRaw(t('test_entity @id has been created.', array('@id' => $id)), 'Entity was created.');
+    $this->assertText(t('entity_test @id has been created.', array('@id' => $id)), 'Entity was created.');
 
     // Render the entity.
-    $entity = field_test_entity_test_load($id);
-    $entities = array($id => $entity);
+    $entity = entity_load('entity_test', $id);
+    $entities = array($id => $entity->getBCEntity());
     $display = entity_get_display($entity->entityType(), $entity->bundle(), 'full');
-    field_attach_prepare_view('test_entity', $entities, array($entity->bundle() => $display));
+    field_attach_prepare_view('entity_test', $entities, array($entity->bundle() => $display));
     $entity->content = field_attach_view($entity, $display);
     $this->content = drupal_render($entity->content);
     $this->assertText($term1->name, 'Term 1 name is displayed.');
@@ -109,10 +111,10 @@ function testTaxonomyTermFieldMultipleVocabularies() {
     taxonomy_vocabulary_delete($this->vocabulary2->id());
 
     // Re-render the content.
-    $entity = field_test_entity_test_load($id);
-    $entities = array($id => $entity);
+    $entity = entity_load('entity_test', $id);
+    $entities = array($id => $entity->getBCEntity());
     $display = entity_get_display($entity->entityType(), $entity->bundle(), 'full');
-    field_attach_prepare_view('test_entity', $entities, array($entity->bundle() => $display));
+    field_attach_prepare_view('entity_test', $entities, array($entity->bundle() => $display));
     $entity->content = field_attach_view($entity, $display);
     $this->plainTextContent = FALSE;
     $this->content = drupal_render($entity->content);
@@ -126,11 +128,13 @@ function testTaxonomyTermFieldMultipleVocabularies() {
     $this->assertEqual(count($field_info['settings']['allowed_values']), 1, 'Only one vocabulary is allowed for the field.');
 
     // The widget should still be displayed.
-    $this->drupalGet('test-entity/add/test_bundle');
+    $this->drupalGet('entity_test/add');
     $this->assertFieldByName("{$this->field_name}[$langcode][]", '', 'Widget is still displayed');
 
     // Term 1 should still pass validation.
     $edit = array(
+      'user_id' => mt_rand(0, 10),
+      'name' => $this->randomName(),
       "{$this->field_name}[$langcode][]" => array($term1->tid),
     );
     $this->drupalPost(NULL, $edit, t('Save'));
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldTest.php
index d5de5fa..15e6b31 100644
--- a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldTest.php
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermFieldTest.php
@@ -19,7 +19,7 @@ class TermFieldTest extends TaxonomyTestBase {
    *
    * @var array
    */
-  public static $modules = array('field_test');
+  public static $modules = array('entity_test');
 
   protected $instance;
   protected $vocabulary;
@@ -35,7 +35,11 @@ public static function getInfo() {
   function setUp() {
     parent::setUp();
 
-    $web_user = $this->drupalCreateUser(array('access field_test content', 'administer field_test content', 'administer taxonomy'));
+    $web_user = $this->drupalCreateUser(array(
+      'view test entity',
+      'administer entity_test content',
+      'administer taxonomy',
+    ));
     $this->drupalLogin($web_user);
     $this->vocabulary = $this->createVocabulary();
 
@@ -56,14 +60,14 @@ function setUp() {
     field_create_field($this->field);
     $this->instance = array(
       'field_name' => $this->field_name,
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
       'widget' => array(
         'type' => 'options_select',
       ),
     );
     field_create_instance($this->instance);
-    entity_get_display('test_entity', 'test_bundle', 'full')
+    entity_get_display('entity_test', 'entity_test', 'full')
       ->setComponent($this->field_name, array(
         'type' => 'taxonomy_term_reference_link',
       ))
@@ -76,22 +80,22 @@ function setUp() {
   function testTaxonomyTermFieldValidation() {
     // Test valid and invalid values with field_attach_validate().
     $langcode = LANGUAGE_NOT_SPECIFIED;
-    $entity = field_test_create_entity();
+    $entity = entity_create('entity_test', array());
     $term = $this->createTerm($this->vocabulary);
-    $entity->{$this->field_name}[$langcode][0]['tid'] = $term->tid;
+    $entity->{$this->field_name}->tid = $term->tid;
     try {
-      field_attach_validate($entity);
+      field_attach_validate($entity->getBCEntity());
       $this->pass('Correct term does not cause validation error.');
     }
     catch (FieldValidationException $e) {
       $this->fail('Correct term does not cause validation error.');
     }
 
-    $entity = field_test_create_entity();
+    $entity = entity_create('entity_test', array());
     $bad_term = $this->createTerm($this->createVocabulary());
-    $entity->{$this->field_name}[$langcode][0]['tid'] = $bad_term->tid;
+    $entity->{$this->field_name}->tid = $bad_term->tid;
     try {
-      field_attach_validate($entity);
+      field_attach_validate($entity->getBCEntity());
       $this->fail('Wrong term causes validation error.');
     }
     catch (FieldValidationException $e) {
@@ -108,30 +112,32 @@ function testTaxonomyTermFieldWidgets() {
 
     // Display creation form.
     $langcode = LANGUAGE_NOT_SPECIFIED;
-    $this->drupalGet('test-entity/add/test_bundle');
+    $this->drupalGet('entity_test/add');
     $this->assertFieldByName("{$this->field_name}[$langcode]", '', 'Widget is displayed.');
 
     // Submit with some value.
     $edit = array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
       "{$this->field_name}[$langcode]" => array($term->tid),
     );
     $this->drupalPost(NULL, $edit, t('Save'));
-    preg_match('|test-entity/manage/(\d+)/edit|', $this->url, $match);
+    preg_match('|entity_test/manage/(\d+)/edit|', $this->url, $match);
     $id = $match[1];
-    $this->assertRaw(t('test_entity @id has been created.', array('@id' => $id)), 'Entity was created.');
+    $this->assertText(t('entity_test @id has been created.', array('@id' => $id)));
 
     // Display the object.
-    $entity = field_test_entity_test_load($id);
-    $entities = array($id => $entity);
+    $entity = entity_load('entity_test', $id);
+    $entities = array($id => $entity->getBCEntity());
     $display = entity_get_display($entity->entityType(), $entity->bundle(), 'full');
-    field_attach_prepare_view('test_entity', $entities, array($entity->bundle() => $display));
+    field_attach_prepare_view('entity_test', $entities, array($entity->bundle() => $display));
     $entity->content = field_attach_view($entity, $display);
     $this->content = drupal_render($entity->content);
     $this->assertText($term->label(), 'Term label is displayed.');
 
     // Delete the vocabulary and verify that the widget is gone.
     taxonomy_vocabulary_delete($this->vocabulary->id());
-    $this->drupalGet('test-entity/add/test_bundle');
+    $this->drupalGet('entity_test/add');
     $this->assertNoFieldByName("{$this->field_name}[$langcode]", '', 'Widget is not displayed');
   }
 
diff --git a/core/modules/text/lib/Drupal/text/Tests/TextFieldTest.php b/core/modules/text/lib/Drupal/text/Tests/TextFieldTest.php
index f8c585b..00430ec 100644
--- a/core/modules/text/lib/Drupal/text/Tests/TextFieldTest.php
+++ b/core/modules/text/lib/Drupal/text/Tests/TextFieldTest.php
@@ -20,7 +20,7 @@ class TextFieldTest extends WebTestBase {
    *
    * @var array
    */
-  public static $modules = array('field_test');
+  public static $modules = array('entity_test');
 
   protected $instance;
   protected $admin_user;
@@ -38,7 +38,7 @@ function setUp() {
     parent::setUp();
 
     $this->admin_user = $this->drupalCreateUser(array('administer filters'));
-    $this->web_user = $this->drupalCreateUser(array('access field_test content', 'administer field_test content'));
+    $this->web_user = $this->drupalCreateUser(array('view test entity', 'administer entity_test content'));
     $this->drupalLogin($this->web_user);
   }
 
@@ -60,24 +60,24 @@ function testTextFieldValidation() {
     field_create_field($this->field);
     $this->instance = array(
       'field_name' => $this->field['field_name'],
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
       'widget' => array(
         'type' => 'text_textfield',
       ),
     );
     field_create_instance($this->instance);
-    entity_get_display('test_entity', 'test_bundle', 'default')
+    entity_get_display('entity_test', 'entity_test', 'default')
       ->setComponent($this->field['field_name'])
       ->save();
 
     // Test valid and invalid values with field_attach_validate().
-    $entity = field_test_create_entity();
+    $entity = entity_create('entity_test', array());
     $langcode = LANGUAGE_NOT_SPECIFIED;
     for ($i = 0; $i <= $max_length + 2; $i++) {
-      $entity->{$this->field['field_name']}[$langcode][0]['value'] = str_repeat('x', $i);
+      $entity->{$this->field['field_name']}->value = str_repeat('x', $i);
       try {
-        field_attach_validate($entity);
+        field_attach_validate($entity->getBCEntity());
         $this->assertTrue($i <= $max_length, "Length $i does not cause validation error when max_length is $max_length");
       }
       catch (FieldValidationException $e) {
@@ -99,14 +99,14 @@ function testTextfieldWidgets() {
    */
   function _testTextfieldWidgets($field_type, $widget_type) {
     // Setup a field and instance
-    $entity_type = 'test_entity';
+    $entity_type = 'entity_test';
     $this->field_name = drupal_strtolower($this->randomName());
     $this->field = array('field_name' => $this->field_name, 'type' => $field_type);
     field_create_field($this->field);
     $this->instance = array(
       'field_name' => $this->field_name,
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
       'label' => $this->randomName() . '_label',
       'settings' => array(
         'text_processing' => TRUE,
@@ -119,14 +119,14 @@ function _testTextfieldWidgets($field_type, $widget_type) {
       ),
     );
     field_create_instance($this->instance);
-    entity_get_display('test_entity', 'test_bundle', 'full')
+    entity_get_display('entity_test', 'entity_test', 'full')
       ->setComponent($this->field_name)
       ->save();
 
     $langcode = LANGUAGE_NOT_SPECIFIED;
 
     // Display creation form.
-    $this->drupalGet('test-entity/add/test_bundle');
+    $this->drupalGet('entity_test/add');
     $this->assertFieldByName("{$this->field_name}[$langcode][0][value]", '', 'Widget is displayed');
     $this->assertNoFieldByName("{$this->field_name}[$langcode][0][format]", '1', 'Format selector is not displayed');
     $this->assertRaw(format_string('placeholder="A placeholder on !widget_type"', array('!widget_type' => $widget_type)));
@@ -134,18 +134,20 @@ function _testTextfieldWidgets($field_type, $widget_type) {
     // Submit with some value.
     $value = $this->randomName();
     $edit = array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
       "{$this->field_name}[$langcode][0][value]" => $value,
     );
     $this->drupalPost(NULL, $edit, t('Save'));
-    preg_match('|test-entity/manage/(\d+)/edit|', $this->url, $match);
+    preg_match('|entity_test/manage/(\d+)/edit|', $this->url, $match);
     $id = $match[1];
-    $this->assertRaw(t('test_entity @id has been created.', array('@id' => $id)), 'Entity was created');
+    $this->assertText(t('entity_test @id has been created.', array('@id' => $id)), 'Entity was created');
 
     // Display the entity.
-    $entity = field_test_entity_test_load($id);
+    $entity = entity_load('entity_test', $id);
     $display = entity_get_display($entity->entityType(), $entity->bundle(), 'full');
-    $entity->content = field_attach_view($entity, $display);
-    $this->content = drupal_render($entity->content);
+    $entity->content = field_attach_view($entity->getBCEntity(), $display);
+    $this->drupalSetContent(drupal_render($entity->content));
     $this->assertText($value, 'Filtered tags are not displayed');
   }
 
@@ -162,14 +164,13 @@ function testTextfieldWidgetsFormatted() {
    */
   function _testTextfieldWidgetsFormatted($field_type, $widget_type) {
     // Setup a field and instance
-    $entity_type = 'test_entity';
     $this->field_name = drupal_strtolower($this->randomName());
     $this->field = array('field_name' => $this->field_name, 'type' => $field_type);
     field_create_field($this->field);
     $this->instance = array(
       'field_name' => $this->field_name,
-      'entity_type' => 'test_entity',
-      'bundle' => 'test_bundle',
+      'entity_type' => 'entity_test',
+      'bundle' => 'entity_test',
       'label' => $this->randomName() . '_label',
       'settings' => array(
         'text_processing' => TRUE,
@@ -179,7 +180,7 @@ function _testTextfieldWidgetsFormatted($field_type, $widget_type) {
       ),
     );
     field_create_instance($this->instance);
-    entity_get_display('test_entity', 'test_bundle', 'full')
+    entity_get_display('entity_test', 'entity_test', 'full')
       ->setComponent($this->field_name)
       ->save();
 
@@ -196,24 +197,26 @@ function _testTextfieldWidgetsFormatted($field_type, $widget_type) {
 
     // Display the creation form. Since the user only has access to one format,
     // no format selector will be displayed.
-    $this->drupalGet('test-entity/add/test_bundle');
+    $this->drupalGet('entity_test/add');
     $this->assertFieldByName("{$this->field_name}[$langcode][0][value]", '', 'Widget is displayed');
     $this->assertNoFieldByName("{$this->field_name}[$langcode][0][format]", '', 'Format selector is not displayed');
 
     // Submit with data that should be filtered.
     $value = '<em>' . $this->randomName() . '</em>';
     $edit = array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
       "{$this->field_name}[$langcode][0][value]" => $value,
     );
     $this->drupalPost(NULL, $edit, t('Save'));
-    preg_match('|test-entity/manage/(\d+)/edit|', $this->url, $match);
+    preg_match('|entity_test/manage/(\d+)/edit|', $this->url, $match);
     $id = $match[1];
-    $this->assertRaw(t('test_entity @id has been created.', array('@id' => $id)), 'Entity was created');
+    $this->assertText(t('entity_test @id has been created.', array('@id' => $id)), 'Entity was created');
 
     // Display the entity.
-    $entity = field_test_entity_test_load($id);
+    $entity = entity_load('entity_test', $id);
     $display = entity_get_display($entity->entityType(), $entity->bundle(), 'full');
-    $entity->content = field_attach_view($entity, $display);
+    $entity->content = field_attach_view($entity->getBCEntity(), $display);
     $this->content = drupal_render($entity->content);
     $this->assertNoRaw($value, 'HTML tags are not displayed.');
     $this->assertRaw(check_plain($value), 'Escaped HTML is displayed correctly.');
@@ -239,22 +242,24 @@ function _testTextfieldWidgetsFormatted($field_type, $widget_type) {
 
     // Display edition form.
     // We should now have a 'text format' selector.
-    $this->drupalGet('test-entity/manage/' . $id . '/edit');
+    $this->drupalGet('entity_test/manage/' . $id . '/edit');
     $this->assertFieldByName("{$this->field_name}[$langcode][0][value]", NULL, 'Widget is displayed');
     $this->assertFieldByName("{$this->field_name}[$langcode][0][format]", NULL, 'Format selector is displayed');
 
     // Edit and change the text format to the new one that was created.
     $edit = array(
+      'user_id' => 1,
+      'name' => $this->randomName(),
       "{$this->field_name}[$langcode][0][format]" => $format_id,
     );
     $this->drupalPost(NULL, $edit, t('Save'));
-    $this->assertRaw(t('test_entity @id has been updated.', array('@id' => $id)), 'Entity was updated');
+    $this->assertText(t('entity_test @id has been updated.', array('@id' => $id)), 'Entity was updated');
 
     // Display the entity.
-    $this->container->get('plugin.manager.entity')->getStorageController('test_entity')->resetCache(array($id));
-    $entity = field_test_entity_test_load($id);
+    $this->container->get('plugin.manager.entity')->getStorageController('entity_test')->resetCache(array($id));
+    $entity = entity_load('entity_test', $id);
     $display = entity_get_display($entity->entityType(), $entity->bundle(), 'full');
-    $entity->content = field_attach_view($entity, $display);
+    $entity->content = field_attach_view($entity->getBCEntity(), $display);
     $this->content = drupal_render($entity->content);
     $this->assertRaw($value, 'Value is displayed unfiltered');
   }
