diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php
index 75bcb39..5332c95 100644
--- a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php
@@ -138,6 +138,31 @@ function testBlock() {
   }
 
   /**
+   * Test creating a block with a duplicate machine name.
+   */
+  function testDuplicateMachineName() {
+    // Configure the 'Powered by Drupal' block.
+    $block = array();
+    $block['id'] = 'system_powered_by_block';
+    $block['settings[label]'] = $this->randomName(8);
+    $block['machine_name'] = strtolower($this->randomName(8));
+    $block['theme'] = config('system.theme')->get('default');
+    $block['region'] = 'header';
+    $this->drupalPost('admin/structure/block/add/' . $block['id'] . '/' . $block['theme'], array('settings[label]' => $block['settings[label]'], 'machine_name' => $block['machine_name'], 'region' => $block['region']), t('Save block'));
+    $this->assertText(t('The block configuration has been saved.'), 'Block title set.');
+
+    // Reuse the machine name and change the plugin id to the 'Help' block.
+    $block['id'] = 'system_help_block';
+    $block['region'] = 'help';
+    $this->drupalPost('admin/structure/block/add/' . $block['id'] . '/' . $block['theme'], array('settings[label]' => $block['settings[label]'], 'machine_name' => $block['machine_name'], 'region' => $block['region']), t('Save block'));
+    $this->assertText(t('The block configuration has been saved.'), 'Block title set.');
+
+    // Check to see if the original block has been overwritten.
+    $instance = entity_load('block', $block['theme'] . '.' . $block['machine_name']);
+    $this->assertEqual($instance->get('plugin'), 'system_powered_by_block');
+  }
+
+  /**
    * Test block title display settings.
    */
   function testHideBlockTitle() {
