diff --git a/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php b/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php
index e3cd861..229a091 100644
--- a/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php
+++ b/core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php
@@ -87,7 +87,14 @@ protected function doCreate(array $values) {
       if (!isset($values[$this->bundleKey])) {
         throw new EntityStorageException('Missing bundle for entity type ' . $this->entityTypeId);
       }
+
+      // Support the bundle value being passed as a plain string or as an array
+      // (for example if $values is based on the result of $entity->toArray()).
+      // Remove all wrapping arrays until we have a string.
       $bundle = $values[$this->bundleKey];
+      while (is_array($bundle)) {
+        $bundle = reset($bundle);
+      }
     }
     $entity = new $this->entityClass(array(), $this->entityTypeId, $bundle);
     $this->initFieldValues($entity, $values);
diff --git a/core/modules/serialization/tests/src/Unit/Normalizer/EntityNormalizerTest.php b/core/modules/serialization/tests/src/Unit/Normalizer/EntityNormalizerTest.php
index 0cd5983..4e1d31c 100644
--- a/core/modules/serialization/tests/src/Unit/Normalizer/EntityNormalizerTest.php
+++ b/core/modules/serialization/tests/src/Unit/Normalizer/EntityNormalizerTest.php
@@ -159,17 +159,10 @@ public function testDenormalizeWithValidBundle() {
       ->with('test_bundle')
       ->will($this->returnValue($entity_type_storage));
 
-    // The expected test data should have a modified test_type property.
-    $expected_test_data = array(
-      'key_1' => 'value_1',
-      'key_2' => 'value_2',
-      'test_type' => 'test_bundle',
-    );
-
     $storage = $this->getMock('Drupal\Core\Entity\EntityStorageInterface');
     $storage->expects($this->once())
       ->method('create')
-      ->with($expected_test_data)
+      ->with($test_data)
       ->will($this->returnValue($this->getMock('Drupal\Core\Entity\EntityInterface')));
 
     $this->entityManager->expects($this->at(3))
@@ -197,14 +190,7 @@ public function testDenormalizeWithInvalidBundle() {
     ];
 
     $entity_type = $this->getMock('Drupal\Core\Entity\EntityTypeInterface');
-    $entity_type->expects($this->once())
-      ->method('hasKey')
-      ->with('bundle')
-      ->will($this->returnValue(TRUE));
-    $entity_type->expects($this->once())
-      ->method('getKey')
-      ->with('bundle')
-      ->will($this->returnValue('test_type'));
+
     $entity_type->expects($this->once())
       ->method('getBundleEntityType')
       ->will($this->returnValue('test_bundle'));
@@ -263,12 +249,6 @@ public function testDenormalizeWithNoBundle() {
     );
 
     $entity_type = $this->getMock('Drupal\Core\Entity\EntityTypeInterface');
-    $entity_type->expects($this->once())
-      ->method('hasKey')
-      ->with('bundle')
-      ->will($this->returnValue(FALSE));
-    $entity_type->expects($this->never())
-      ->method('getKey');
 
     $this->entityManager->expects($this->once())
       ->method('getDefinition')
diff --git a/core/tests/Drupal/Tests/Core/Entity/ContentEntityStorageBaseTest.php b/core/tests/Drupal/Tests/Core/Entity/ContentEntityStorageBaseTest.php
new file mode 100644
index 0000000..05e7bd7
--- /dev/null
+++ b/core/tests/Drupal/Tests/Core/Entity/ContentEntityStorageBaseTest.php
@@ -0,0 +1,96 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\Tests\Core\Entity\ContentEntityStorageBase.
+ */
+
+namespace Drupal\Tests\Core\Entity;
+
+use Drupal\Tests\UnitTestCase;
+
+/**
+ * @group Entity
+ */
+class ContentEntityStorageBaseTest extends UnitTestCase {
+
+  /**
+   * The storage under test.
+   *
+   * @var \Drupal\Core\Entity\ontentEntityStorageBase|\PHPUnit_Framework_MockObject_MockObject
+   */
+  protected $storage;
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function setUp() {
+    $entity = $this->getMock('Drupal\\Core\\Entity\\EntityInterface');
+
+    $entity_type = $this->getMock('Drupal\\Core\\Entity\\EntityTypeInterface');
+
+    $entity_type->method('id')
+                ->will($this->returnValue('node'));
+
+    $map = [
+      ['id', 'nid'],
+      ['uuid', 'uuid'],
+      ['langcode', 'langcode'],
+      ['bundle', 'type'],
+    ];
+
+    $entity_type->method('getKey')
+                ->will($this->returnValueMap($map));
+
+    $entity_type->method('getClass')
+                ->will($this->returnValue(get_class($entity)));
+
+    $this->storage = $this->getMockBuilder('Drupal\\Core\\Entity\\ContentEntityStorageBase')
+                          ->setConstructorArgs([$entity_type])
+                          ->getMockForAbstractClass();
+  }
+
+  /**
+   * @dataProvider providerDoCreate
+   */
+  public function testDoCreate($values) {
+
+    $create = new \ReflectionMethod($this->storage, 'doCreate');
+    $create->setAccessible(TRUE);
+
+    $entity = $create->invoke($this->storage, $values);
+
+    foreach ($values as $key => $value) {
+      $this->assertObjectHasAttribute($key, $entity);
+
+      $this->assertEquals($value, $entity->$key);
+    }
+
+  }
+
+  /**
+   * Data provider for testDoCreate().
+   *
+   * @returns array
+   *   - Array to generate an Entity from.
+   */
+  public function providerDoCreate() {
+    return [
+      [
+        [
+          'type' => [
+            [
+              'target_id' => 'article'
+            ],
+          ],
+        ],
+      ],
+      [
+        [
+          'type' => 'article',
+        ],
+      ],
+    ];
+  }
+
+}
