diff --git a/tests/src/Functional/BlockContentMachineNameTest.php b/tests/src/Functional/BlockContentMachineNameTest.php
new file mode 100644
index 0000000..b9d2b58
--- /dev/null
+++ b/tests/src/Functional/BlockContentMachineNameTest.php
@@ -0,0 +1,90 @@
+<?php
+
+namespace Drupal\Tests\block_content_machine_name\Functional;
+
+use Drupal\Tests\block_content\Functional\BlockContentTestBase;
+
+/**
+ * Tests the machine name creation for block content.
+ *
+ * @group block_content_machine_name
+ */
+class BlockContentMachineNameTest extends BlockContentTestBase {
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = [
+    'block',
+    'block_content',
+    'machine_name_widget',
+    'block_content_machine_name',
+    'field_ui',
+  ];
+
+  /**
+   * Permissions to grant admin user.
+   *
+   * @var array
+   */
+  protected $permissions = [
+    'administer blocks',
+    'administer block_content display',
+  ];
+
+  /**
+   * Sets the test up.
+   */
+  protected function setUp() {
+    parent::setUp();
+    $this->drupalLogin($this->adminUser);
+  }
+
+  /**
+   * Creates a basic block and verifies its machine name.
+   */
+  public function testBlockContentMachineName() {
+    $this->drupalLogin($this->adminUser);
+
+    // Create a block with machine name.
+    $edit = [];
+    $edit['info[0][value]'] = 'Test Block';
+    $edit['machine_name[0][value]'] = 'test_block';
+    $edit['body[0][value]'] = $this->randomMachineName(16);
+    $this->drupalPostForm('block/add/basic', $edit, t('Save'));
+
+    // Check that the Basic block has been created.
+    $this->assertRaw(format_string('@block %name has been created.', [
+      '@block' => 'basic',
+      '%name' => $edit['info[0][value]'],
+    ]), 'Basic block created.');
+
+    // Check that the block exists in the database.
+    $blocks = \Drupal::entityManager()
+      ->getStorage('block_content')
+      ->loadByProperties(['machine_name' => $edit['machine_name[0][value]']]);
+    $block = reset($blocks);
+    $this->assertTrue($block, 'Custom Block found in database.');
+  }
+
+  /**
+   * Check for the existing machine name.
+   */
+  public function testBlockContentExistingMachineName() {
+    // Create a block with machine name.
+    $this->testBlockContentMachineName();
+    // Check that attempting to create another block with the same value for
+    // 'machine_name' returns an error.
+    $edit = [];
+    $edit['info[0][value]'] = 'Test Block 2';
+    $edit['machine_name[0][value]'] = 'test_block';
+    $this->drupalPostForm('block/add/basic', $edit, t('Save'));
+
+    // Check that the Basic block has been created.
+    $this->assertRaw(t('The machine-readable name is already in use. It must be unique.'));
+    $this->assertResponse(200);
+  }
+
+}
