diff --git a/src/Tests/FlagUserFlagTest.php b/src/Tests/FlagUserFlagTest.php
new file mode 100644
index 0000000..27efcca
--- /dev/null
+++ b/src/Tests/FlagUserFlagTest.php
@@ -0,0 +1,134 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\flag\FlagUserFlagTest.
+ */
+
+namespace Drupal\flag\Tests;
+
+use Drupal\simpletest\WebTestBase;
+use Drupal\user\Entity\Role;
+
+
+/**
+ * Tests the Flag form actions (add/edit/delete).
+ *
+ * @group flag
+ */
+class FlagUserFlagTest extends WebTestBase {
+
+  /**
+   * Set to TRUE to strict check all configuration saved.
+   *
+   * @see \Drupal\Core\Config\Testing\ConfigSchemaChecker
+   *
+   * @var bool
+   */
+  protected $strictConfigSchema = FALSE;
+
+  /**
+   * The label of the flag to create for the test.
+   *
+   * @var string
+   */
+  protected $label = 'Test label 123';
+
+  /**
+   * The ID of the flag to create for the test.
+   *
+   * @var string
+   */
+  protected $id = 'test_label_123';
+
+  /**
+   * The flag link type.
+   *
+   * @var string
+   */
+  protected $flagLinkType;
+
+  /**
+   * The node type to use in the test.
+   *
+   * @var string
+   */
+  protected $nodeType = 'article';
+
+  protected $flagShortText = 'Flag this stuff';
+  protected $unflagShortText = 'Unflag this stuff';
+
+  /**
+   * User object.
+   *
+   * @var \Drupal\user\Entity\User|false
+   */
+  protected $adminUser;
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = array('views', 'flag', 'node', 'field_ui');
+
+  /**
+   * Configures test base and executes test cases.
+   */
+  public function testFlagForm() {
+    // Create and log in our user.
+    $this->adminUser = $this->drupalCreateUser([
+      'administer flags',
+      'administer flagging display',
+      'administer node display',
+    ]);
+
+    $this->drupalLogin($this->adminUser);
+
+    // Create a flag.
+    $this->doCreateFlag();
+
+    $this->doTestUsersMayFlagThemselvesCheckbox();
+  }
+
+  /**
+   * Create a node type and a flag.
+   */
+  public function doCreateFlag() {
+    // Create content type.
+    $this->drupalCreateContentType(['type' => $this->nodeType]);
+
+    // Test with minimal value requirement.
+    $edit = [
+      'flag_entity_type' => 'flagtype_user',
+    ];
+    $this->drupalPostForm('admin/structure/flags/add', $edit, t('Continue'));
+
+    $edit = [
+      'label' => $this->label,
+      'id' => $this->id,
+      'unflag_short' => $this->unflagShortText,
+    ];
+    $this->drupalPostForm(NULL, $edit, t('Create Flag'));
+  }
+
+  /**
+   * Users may flag themselves checkbox.
+   */
+  public function doTestUsersMayFlagThemselvesCheckbox() {
+
+    // The checkbox should be selected by default.
+    $this->drupalGet('admin/structure/flags/manage/' . $this->id);
+    $this->assertFieldChecked('edit-access-uid', 'The Users may flag themselves checkbox is selected by default.');
+
+    // Uncheck "Users may flag themselves".
+    $edit = [
+      'access_uid' => FALSE,
+    ];
+    $this->drupalPostForm('admin/structure/flags/manage/' . $this->id, $edit, t('Save Flag'));
+
+    // The checkbox should not be selected anymore.
+    $this->drupalGet('admin/structure/flags/manage/' . $this->id);
+    $this->assertNoFieldChecked('edit-access-uid', 'The Users may flag themselves should stay unchecked.');
+  }
+}
