diff --git a/core/includes/common.inc b/core/includes/common.inc
diff --git a/core/modules/entity/entity.controller.inc b/core/modules/entity/entity.controller.inc
diff --git a/core/modules/entity/entity.module b/core/modules/entity/entity.module
diff --git a/core/modules/simpletest/drupal_web_test_case.php b/core/modules/simpletest/drupal_web_test_case.php
index 5c711fb..bba89b5 100644
--- a/core/modules/simpletest/drupal_web_test_case.php
+++ b/core/modules/simpletest/drupal_web_test_case.php
@@ -1116,7 +1116,9 @@ class DrupalWebTestCase extends DrupalTestCase {
     $edit['pass']   = user_password();
     $edit['status'] = 1;
 
-    $account = user_save(drupal_anonymous_user(), $edit);
+    $User = entity_create('user', $edit);
+
+    $account = $User->save();
 
     $this->assertTrue(!empty($account->uid), t('User created with name %name and pass %pass', array('%name' => $edit['name'], '%pass' => $edit['pass'])), t('User login'));
     if (empty($account->uid)) {
diff --git a/core/modules/user/user.entity.inc b/core/modules/user/user.entity.inc
index 5549c77..92a2f4b 100644
--- a/core/modules/user/user.entity.inc
+++ b/core/modules/user/user.entity.inc
@@ -5,12 +5,131 @@
  */
 
 /**
+ * Defines the user entity class
+ */
+class User extends Entity {
+
+  /**
+   * The user ID.
+   *
+   * @var integer
+   */
+  public $uid;
+
+  /**
+   * The unique user name.
+   *
+   * @var string
+   */
+  public $name = '';
+
+  /**
+   * The user's password (hashed).
+   *
+   * @var string
+   */
+  public $pass;
+
+  /**
+   * The user's email address.
+   *
+   * @var string
+   */
+  public $mail = '';
+
+  /**
+   * The user's default theme.
+   *
+   * @var string
+   */
+  public $theme;
+
+  /**
+   * The user's signature.
+   *
+   * @var string
+   */
+  public $signature;
+
+  /**
+   * The user's signature format.
+   *
+   * @var string
+   */
+  public $signature_format = NULL;
+
+  /**
+   * The timestamp when the user was created.
+   *
+   * @var integer
+   */
+  public $created = 0;
+
+  /**
+   * The timestamp when the user last accessed the site.
+   *
+   * @var integer
+   */
+  public $access = 0;
+
+  /**
+   * The timestamp when the user lasted logged in.
+   *
+   * @var integer
+   */
+  public $login = 0;
+
+  /**
+   * Whether the user is active(1) or blocked(0).
+   *
+   * @var integer
+   */
+  public $status = 0;
+
+  /**
+   * The user's timezone.
+   *
+   * @var string
+   */
+  public $timezone = NULL;
+
+  /**
+   * The user's default language.
+   *
+   * @var string
+   */
+  public $language = '';
+
+  /**
+   * The fid of the user's picture.
+   *
+   * @var integer
+   */
+  public $picture = 0;
+
+  /**
+   * The email address used for initial account creation.
+   *
+   * @var string
+   */
+  public $init = '';
+
+  /**
+   * The user's roles.
+   *
+   * @var array
+   */
+  public $roles = array();
+
+}
+
+/**
  * Controller class for users.
  *
  * This extends the DrupalDefaultEntityController class, adding required
  * special handling for user objects.
  */
-class UserController extends DrupalDefaultEntityController {
+class UserController extends EntityDatabaseStorageController {
 
   function attachLoad(&$queried_users, $revision_id = FALSE) {
     // Build an array of user picture IDs so that these can be fetched later.
@@ -49,4 +168,11 @@ class UserController extends DrupalDefaultEntityController {
     // hook_user_load().
     parent::attachLoad($queried_users, $revision_id);
   }
+
+  function save(EntityInterface $entity) {
+    if (empty($entity->uid)) {
+      $entity->uid = db_next_id(db_query('SELECT MAX(uid) FROM {users}')->fetchField());
+    }
+    parent::save($entity);
+  }
 }
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index 2dded35..7905fab 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -143,7 +143,7 @@ function user_theme() {
  * Implements hook_entity_info().
  */
 function user_entity_info() {
-  $return = array(
+  return array(
     'user' => array(
       'label' => t('User'),
       'controller class' => 'UserController',
@@ -151,6 +151,7 @@ function user_entity_info() {
       'uri callback' => 'user_uri',
       'label callback' => 'user_label',
       'fieldable' => TRUE,
+      'entity class' => 'User',
       'entity keys' => array(
         'id' => 'uid',
       ),
@@ -171,7 +172,6 @@ function user_entity_info() {
       ),
     ),
   );
-  return $return;
 }
 
 /**
