diff --git a/addanother.info.yml b/addanother.info.yml
index 4bb63f0..2c9ec02 100644
--- a/addanother.info.yml
+++ b/addanother.info.yml
@@ -3,4 +3,5 @@ description: Presents users with an option to create another node of the same ty
 type: module
 core: 8.x
 package: User interface
-version: 8.x-1.x
\ No newline at end of file
+version: 8.x-1.x
+configure: addanother.admin_config
diff --git a/addanother.install b/addanother.install
index cb7b18d..970581b 100644
--- a/addanother.install
+++ b/addanother.install
@@ -7,28 +7,8 @@
  */
 
 /**
- * Implements hook_install().
- */
-function addanother_install() {
-  if (\Drupal::moduleHandler()->moduleExists('node')) {
-    $node_types = array_keys(node_type_get_names());
-    foreach ($node_types as $type_id) {
-      \Drupal::config('addanother.entity.node.' . $type_id)
-          ->set('addanother_button', 0)
-          ->set('addanother_message', 0)
-          ->set('addanother_tab', 0)
-          ->set('addanother_tab_edit', 0)
-          ->save();
-    }
-  }
-}
-
-/**
- * Implements hook_install().
+ * Implement hook_uninstall().
  */
 function addanother_uninstall() {
-  $node_types = array_keys(node_type_get_names());
-  foreach ($node_types as $type_id) {
-    \Drupal::config('addanother.entity.node.' . $type_id)->delete();
-  }
-}
\ No newline at end of file
+  \Drupal::service('config.factory')->getEditable('addanother')->delete();
+}
diff --git a/addanother.links.task.yml b/addanother.links.task.yml
new file mode 100644
index 0000000..1b5f64a
--- /dev/null
+++ b/addanother.links.task.yml
@@ -0,0 +1,5 @@
+addanother.redirect:
+  route_name: addanother.redirect
+  base_route: entity.node.canonical
+  title: Add another
+  weight: 20
diff --git a/addanother.local_tasks.yml b/addanother.local_tasks.yml
deleted file mode 100644
index a291c36..0000000
--- a/addanother.local_tasks.yml
+++ /dev/null
@@ -1,5 +0,0 @@
-addanother.add:
-  route_name: addanother.add
-  base_route: node.view
-  title: 'Add Another'
-  weight: 5
\ No newline at end of file
diff --git a/addanother.module b/addanother.module
index f30f564..9a099d9 100644
--- a/addanother.module
+++ b/addanother.module
@@ -6,79 +6,67 @@
  * node is added.
  */
 
+use Drupal\Core\Form\FormStateInterface;
+use Drupal\Core\Render\Markup;
+use Drupal\Core\Routing\RouteMatchInterface;
+use Drupal\Core\Url;
+
 /**
- * Implement hook_help().
+ * Implements hook_help().
  */
-function addanother_help($path, $arg) {
-  if ($path == "admin/help#addanother") {
-    return '<p>' . t("Presents users with an option to create another node of the same type after a node is added.") . '</p>';
+function addanother_help($route_name, RouteMatchInterface $route_match) {
+  switch ($route_name) {
+    case 'help.page.addanother':
+      return t("Presents users with an option to create another node of the same type after a node is added.");
   }
 }
 
 /**
- * Implement hook_permission().
+ * Implements hook_form_BASE_FORM_form_alter().
  */
-function addanother_permission() {
-  return array(
-    'administer add another' => array(
-      'title' => t('Administer Add Another'),
-      'description' => t('Configure content types for Add Another'),
-    ),
-    'use add another' => array(
-      'title' => t('Use Add Another'),
-      'description' => t('Use the "Add Another..." link or button to create additional content'),
-    ),
-  );
-}
+function addanother_form_node_type_form_alter(&$form, FormStateInterface &$form_state, $form_id) {
+  $config = \Drupal::config('addanother.settings');
+  if ($node_type = $form_state->getFormObject()->getEntity()) {
+    $type = $node_type->get('type');
+    // Get content type addanother settings.
+    $button = $config->get('button.' . $type);
+    $message = $config->get('message.' . $type);
+    $tab = $config->get('tab.' . $type);
+    $tab_edit = $config->get('tab_edit.' . $type);
 
-/**
- * Implements hook_form_BASE_FORM_ID_alter().
- *
- * Adds addanother item fields to the node form.
- */
-function addanother_form_node_type_form_alter(&$form, &$form_state) {
-  $type = $form_state['controller']->getEntity();
-  if ($type->id()) {
-    $config_values = \Drupal::config('addanother.entity.node.' . $type->id())->get();
-  }
-  else {
-    $config_values = array(
-      'addanother_button' => 0,
-      'addanother_message' => 0,
-      'addanother_tab' => 0,
-      'addanother_tab_edit' => 0,
-    );
-  }
-  if (isset($form['type'])) {
     $form['addanother_display'] = array(
       '#type' => 'details',
       '#title' => t('Add another settings'),
       '#collapsible' => TRUE,
       '#group' => 'additional_settings',
     );
-    $form['addanother_display']['addanother_button'] = array(
+
+    $form['addanother_display']['button'] = array(
       '#type' => 'checkbox',
       '#title' => t('Display Add another button on node add form.'),
-      '#default_value' => $config_values['addanother_button'],
+      '#default_value' => isset($button) ? $button : $config->get('default_button'),
       '#description' => t('Enable this checkbox if you want to provide a "Save and add another" button on the node add form for your users.'),
     );
-    $form['addanother_display']['addanother_message'] = array(
+
+    $form['addanother_display']['message'] = array(
       '#type' => 'checkbox',
       '#title' => t('Display the Add another message after node creation.'),
-      '#default_value' => $config_values['addanother_message'],
+      '#default_value' => isset($message) ? $message : $config->get('default_message'),
       '#description' => t('Enable this checkbox if you want to show a "Add another..." message after creating a new node.'),
     );
-    $form['addanother_display']['addanother_tab'] = array(
+
+    $form['addanother_display']['tab'] = array(
       '#type' => 'checkbox',
       '#title' => t('Display the Add another tab.'),
-      '#default_value' => $config_values['addanother_tab'],
+      '#default_value' => isset($tab) ? $tab : $config->get('default_tab'),
       '#description' => t('Enable this checkbox if you want to show a "Add another" tab on nodes of this type.'),
     );
-    $form['addanother_display']['addanother_tab_edit'] = array(
+
+    $form['addanother_display']['tab_edit'] = array(
       '#type' => 'checkbox',
       '#title' => t('Also Display Add another tab on edit page.'),
-      '#default_value' => $config_values['addanother_tab_edit'],
-      '#description' => t('Enable this checkbox if you want to also show a "Add another" tab on node edit pages of this type. Tis option does nothing if the Add Another tab is disabled.'),
+      '#default_value' => isset($tab_edit) ? $tab_edit : $config->get('default_tab_edit'),
+      '#description' => t('Enable this checkbox if you want to also show a "Add another" tab on node edit pages of this type. This option does nothing if the Add Another tab is disabled.'),
     );
 
     $form['actions']['submit']['#submit'][] = 'addanother_form_node_type_form_submit';
@@ -86,44 +74,111 @@ function addanother_form_node_type_form_alter(&$form, &$form_state) {
 }
 
 /**
- * Submit handler for forms with addanother options.
- *
- * @see addanother_form_node_type_form_alter().
+ * Custom handler submit for node type form.
  */
-function addanother_form_node_type_form_submit(&$form, $form_state) {
-  $type = $form_state['controller']->getEntity();
-  \Drupal::config('addanother.entity.node.' . $type->id())
-      ->set('addanother_button', $form_state['values']['addanother_button'])
-      ->set('addanother_message', $form_state['values']['addanother_message'])
-      ->set('addanother_tab', $form_state['values']['addanother_tab'])
-      ->set('addanother_tab_edit', $form_state['values']['addanother_tab_edit'])
-      ->save();
+function addanother_form_node_type_form_submit(&$form, FormStateInterface $form_state) {
+  $node_type = $form_state->getFormObject()->getEntity();
+  $type = $node_type->get('type');
+  $config = \Drupal::service('config.factory')->getEditable('addanother.settings');
+  $config
+    ->set('button.' . $type, $form_state->getValue('button'))
+    ->set('message.' . $type, $form_state->getValue('message'))
+    ->set('tab.' . $type, $form_state->getValue('tab'))
+    ->set('tab_edit.' . $type, $form_state->getValue('tab_edit'))
+    ->save();
 }
 
 /**
- * Implement hook_form_BASE_FORM_ID_alter().
+ * Implements hook_form_BASE_FORM_ID_form_alter().
  */
-function addanother_form_node_form_alter(&$form, $form_state, $form_id) {
-  $node = $form_state['controller']->getEntity();
-  if (empty($node->id())) {
-    $account = \Drupal::currentUser();
-    $access = $account->hasPermission('use add another');
-    $node_type = $node->getType();
-    if ($access) {
-      $config_values = \Drupal::config('addanother.entity.node.' . $node->getType())->get();
-      if ($config_values['addanother_button']) {
-        $form['actions']['addanother'] = array(
-          '#type' => 'submit',
-          '#value' => t('Save and add another'),
-          '#weight' => 21,
-        );
-        $form['actions']['addanother']['#submit'] = $form['actions']['publish']['#submit'];
-        $form['actions']['addanother']['#submit'][] = 'addanother_node_form_submit';
+function addanother_form_node_form_alter(&$form, FormStateInterface &$form_state) {
+  if ($node = $form_state->getFormObject()->getEntity()) {
+    if (empty($node->Id())) {
+      $type = $node->getType();
+      $config = \Drupal::config('addanother.settings');
+      $account = \Drupal::currentUser();
+
+      if ($account->hasPermission('use add another')) {
+        $button = $config->get('button.' . $type);
+        if ($button) {
+          $form['actions']['addanother'] = array(
+            '#attributes' => array(
+              'class' => array('button'),
+            ),
+            '#type' => 'submit',
+            '#value' => t('Save and add another'),
+            '#weight' => 50,
+            '#submit' => $form['actions']['submit']['#submit'],
+          );
+          $form['actions']['addanother']['#submit'][] = 'addanother_node_form_submit';
+        }
       }
 
-      if ($config_values['addanother_message']) {
+      if ($config->get('message.' . $type)) {
         $form['actions']['submit']['#submit'][] = 'addanother_node_form_message_submit';
+        $form['actions']['publish']['#submit'][] = 'addanother_node_form_message_submit';
+        $form['actions']['unpublish']['#submit'][] = 'addanother_node_form_message_submit';
       }
     }
   }
-}
\ No newline at end of file
+}
+
+/**
+ * Submit handler for the 'Save and add another' button.
+ */
+function addanother_node_form_submit($form, FormStateInterface &$form_state) {
+  if ($node = $form_state->getFormObject()->getEntity()) {
+    $type = $node->getType();
+    $form_state->setRedirect('node.add', array(
+        'node_type' => $type,
+      )
+    );
+    _addanother_quelch_message($node);
+    $t_args = array(
+      '@type' => node_get_type_label($node),
+      '%title' => $node->label(),
+      ':node_link' => $node->url(),
+    );
+    drupal_set_message(t('@type <a href=":node_link">%title</a> has been created. You may now create another.', $t_args));
+  }
+}
+
+/**
+ * Submit handler if the normal submit button was pressed.
+ */
+function addanother_node_form_message_submit($form, FormStateInterface &$form_state) {
+  if ($node = $form_state->getFormObject()->getEntity()) {
+    _addanother_quelch_message($node);
+    $type_url = Url::fromRoute('node.add', ['node_type' => str_replace('_', '-', $node->getType())]);
+    $t_args = array(
+      '@type' => node_get_type_label($node),
+      '%title' => $node->label(),
+      ':node_link' => $node->url(),
+      ':type_url' => $type_url->toString(),
+    );
+    drupal_set_message(t('@type <a href=":node_link">%title</a> has been created. You may <a href=":type_url">add another @type</a>.', $t_args));
+  }
+}
+
+/**
+ * Remove the default Drupal node creation message.
+ */
+function _addanother_quelch_message($node) {
+  if (!isset($_SESSION['messages']['status'])) {
+    return FALSE;
+  }
+
+  $t_args = array(
+    '@type' => node_get_type_label($node),
+    '%title' => $node->getTitle(),
+  );
+  $message = t('@type %title has been created.', $t_args);
+  $remove[] = Markup::create((string) $message);
+
+  if ($messages = array_diff($_SESSION['messages']['status'], $remove)) {
+    $_SESSION['messages']['status'] = $messages;
+  }
+  else {
+    drupal_get_messages('status', TRUE);
+  }
+}
diff --git a/addanother.permissions.yml b/addanother.permissions.yml
new file mode 100644
index 0000000..1a87621
--- /dev/null
+++ b/addanother.permissions.yml
@@ -0,0 +1,6 @@
+'administer add another':
+  title: Administer Add Another
+  description: Configure content types for Add Another.
+'use add another':
+  title: Use Add Another
+  description: Use the "Add Another..." link or button to create additional content.
diff --git a/addanother.routing.yml b/addanother.routing.yml
index 2d32dfb..6bfb28f 100644
--- a/addanother.routing.yml
+++ b/addanother.routing.yml
@@ -1,8 +1,18 @@
-addanother.add:
-  path: '/node/{node}/addanother'
+addanother.admin_config:
+  path: 'admin/structure/types/addanother'
   defaults:
-    _content: '\Drupal\addanother\Controller\addanotherController::add'
-  options:
-    _admin_route: TRUE
+    _form: '\Drupal\addanother\Form\AddAnotherSettingsForm'
+    _title: 'Add another'
+    _description: 'Modify which node types display the Add another message.'
+  requirements:
+    _permission: 'administer add another'
+
+addanother.redirect:
+  path: 'node/{node}/addanother'
+  defaults:
+    _controller: '\Drupal\addanother\Controller\AddAnotherController::addAnotherGoTo'
+    _title: 'Add another redirect'
   requirements:
-    _custom_access: '\Drupal\addanother\Controller\addanotherController::checkaddanotherAccess'
\ No newline at end of file
+    _custom_access: '\Drupal\addanother\Controller\AddAnotherController::addAnotherAccess'
+  options:
+      _admin_route: TRUE
diff --git a/addanother.test b/addanother.test
deleted file mode 100644
index a9d6474..0000000
--- a/addanother.test
+++ /dev/null
@@ -1,64 +0,0 @@
-<?php
-
-/**
- * @file
- * Unit tests for Add another modu
- */
-
-class AddanotherTestCase extends DrupalWebTestCase {
-  protected $privileged_user;
-
-  public static function getInfo() {
-    return array(
-      'name' => 'Add another',
-      'description' => 'Ensure that the Add another functionality works correctly.',
-      'group' => 'Add another',
-    );
-  }
-
-  public function setUp() {
-    parent::setUp('addanother');
-  }
-  
-  public function testAddanother() {
-    $nodetype = $this->randomName(8);
-    variable_set("addanother_button_$nodetype", TRUE);
-    variable_set("addanother_message_$nodetype", TRUE);
-    variable_set("addanother_tab_$nodetype", TRUE);
-    variable_set("addanother_tab_edit_$nodetype", TRUE);
-    $settings = array(
-      'type' => $nodetype,
-      'name' => $nodetype,
-    );
-    $type = $this->drupalCreateContentType($settings);
-    
-    $type_exists = db_query('SELECT 1 FROM {node_type} WHERE type = :type', array(':type' => $type->type))->fetchField();
-    $this->assertTrue($type_exists, 'The new content type has been created in the database.');
-    
-    $web_user = $this->drupalCreateUser(array('bypass node access', 'administer content types', 'use add another', 'administer add another'));
-    $this->drupalLogin($web_user);
-    
-    // Create a node.
-    $edit = array();
-    $langcode = LANGUAGE_NONE;
-    $edit["title"] = $this->randomName(8);
-    $edit["body[$langcode][0][value]"] = $this->randomName(16);
-    $this->drupalPost("node/add/$nodetype", $edit, t('Save'));
-    
-    // Check that the node has been created
-    $this->assertRaw(t('!post %title has been created.', array('!post' => $nodetype, '%title' => $edit["title"])), t('Node created.'));
-    $this->assertText(t('Add another !type.', array('!type' => $nodetype)), t('Addanother message was presented.'));
-    $this->assertLink('Add another');
-    
-    // Create a node.
-    $edit = array();
-    $langcode = LANGUAGE_NONE;
-    $edit["title"] = $this->randomName(8);
-    $edit["body[$langcode][0][value]"] = $this->randomName(16);
-    $this->drupalPost("node/add/$nodetype", $edit, t('Save and add another'));
-    
-    // Check that the node has been created
-    $this->assertUrl("node/add/$nodetype");
-  }
-
-}
diff --git a/config/install/addanother.settings.yml b/config/install/addanother.settings.yml
new file mode 100644
index 0000000..534cdbd
--- /dev/null
+++ b/config/install/addanother.settings.yml
@@ -0,0 +1,4 @@
+default_button: TRUE
+default_message: TRUE
+default_tab: TRUE
+default_tab_edit: TRUE
diff --git a/config/schema/addanother.schema.yml b/config/schema/addanother.schema.yml
new file mode 100644
index 0000000..ea65432
--- /dev/null
+++ b/config/schema/addanother.schema.yml
@@ -0,0 +1,41 @@
+# Schema for the configuration files of the addanother module.
+addanother.settings:
+  type: config_object
+  label: 'Node settings'
+  mapping:
+    default_button:
+      type: boolean
+      label: 'Default settings for displaying Add another button on node add form.'
+    default_message:
+      type: boolean
+      label: 'Default settings for displaying Add another message after node creation.'
+    default_tab:
+      type: boolean
+      label: 'Default settings for displaying Add another tab.'
+    default_tab_edit:
+      type: boolean
+      label: 'Default settings for displaying Add another tab on edit page.'
+    button:
+      type: sequence
+      label: 'Add another buttons'
+      sequence:
+        type: boolean
+        label: 'Add another button'
+    message:
+      type: sequence
+      label: 'Add another messages'
+      sequence:
+        type: boolean
+        label: 'Add another message'
+    tab:
+      type: sequence
+      label: 'Add another tabs'
+      sequence:
+        type: boolean
+        label: 'Add another tab'
+    tab_edit:
+      type: sequence
+      label: 'Add another edit tabs'
+      sequence:
+        type: boolean
+        label: 'Add another edit tab'
diff --git a/lib/Drupal/addanother/Controller/addanotherController.php b/lib/Drupal/addanother/Controller/addanotherController.php
deleted file mode 100644
index 6568821..0000000
--- a/lib/Drupal/addanother/Controller/addanotherController.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-
-/**
- * @file
- * Contains \Drupal\menu\Controller\MenuController.
- */
-
-namespace Drupal\addanother\Controller;
-
-use Drupal\Core\Controller\ControllerBase;
-use Drupal\node\NodeInterface;
-use Drupal\Core\Access\AccessInterface;
-use Symfony\Component\HttpFoundation\Request;
-
-/**
- * Returns responses for Menu routes.
- */
-class addanotherController extends ControllerBase {
-
-  //Takes the user to the node creation page for the type of a given node.
-  public function add(NodeInterface $node) {
-    return $this->redirect('node.add', array('node_type' => $node->getType()));
-  }
-
-  /**
-   * Checks access for the subtree controller.
-   */
-  public function checkaddanotherAccess(Request $request, NodeInterface $node) {
-    $config_values = \Drupal::config('addanother.entity.node.' . $node->getType())->get();
-    if (!($node->access('create', $this->currentUser()))) {
-      return AccessInterface::DENY;
-    }
-    if (arg(2) == "edit" && !$config_values['addanother_tab_edit']) {
-      return AccessInterface::DENY;
-    }
-    if ($node && $config_values['addanother_tab'] && $this->currentUser()->hasPermission('use add another')) {
-      return AccessInterface::ALLOW;
-    }
-    return AccessInterface::DENY;
-  }
-
-}
\ No newline at end of file
diff --git a/src/Controller/AddAnotherController.php b/src/Controller/AddAnotherController.php
new file mode 100644
index 0000000..369b7ab
--- /dev/null
+++ b/src/Controller/AddAnotherController.php
@@ -0,0 +1,48 @@
+<?php
+/**
+ * @file
+ * Contains \Drupal\addanother\Controller\AddAnotherController.
+ */
+
+namespace Drupal\addanother\Controller;
+
+use Drupal\Core\Access\AccessResult;
+use Drupal\Core\Controller\ControllerBase;
+use Drupal\node\NodeInterface;
+
+/**
+ * Controller routines for Add another routes.
+ */
+class AddAnotherController extends ControllerBase {
+
+ /**
+  * Takes the user to the node creation page for the type of a given node.
+  */
+  public function addAnotherGoTo(NodeInterface $node) {
+    return $this->redirect('node.add', ['node_type' => str_replace('_', '-', $node->getType())]);
+  }
+
+  /**
+   * Takes the user to the node creation page for the type of a given node.
+   */
+  public function addAnotherAccess(NodeInterface $node) {
+    if (!$node->access('create')) return AccessResult::forbidden();
+
+    $config = \Drupal::config('addanother.settings');
+    $account = \Drupal::currentUser();
+    $type = $node->getType();
+
+    if (\Drupal::routeMatch()->getRouteName() == 'entity.node.edit_form' &&
+      !$config->get('tab_edit.' . $type)) {
+      return AccessResult::forbidden();
+    }
+
+    if ($config->get('tab.' . $type) &&
+      $account->hasPermission('use add another')) {
+      return AccessResult::allowed();
+    }
+
+    return AccessResult::forbidden();
+  }
+
+}
diff --git a/src/Form/AddAnotherSettingsForm.php b/src/Form/AddAnotherSettingsForm.php
new file mode 100644
index 0000000..f989ac3
--- /dev/null
+++ b/src/Form/AddAnotherSettingsForm.php
@@ -0,0 +1,80 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\addanother\Form\AddAnotherSettingsForm.
+ */
+
+namespace Drupal\addanother\Form;
+
+use Drupal\Core\Form\ConfigFormBase;
+use Drupal\Core\Form\FormStateInterface;
+
+/**
+ * Configure Add another settings for this site.
+ */
+class AddAnotherSettingsForm extends ConfigFormBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function getFormId() {
+    return 'addanother_admin_settings';
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  protected function getEditableConfigNames() {
+    return ['addanother.settings'];
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function buildForm(array $form, FormStateInterface $form_state) {
+    $config = $this->config('addanother.settings');
+
+    $form['addanother_display'] = array(
+      '#type' => 'fieldset',
+      '#title' => $this->t('Default settings for newly created content types'),
+    );
+    $form['addanother_display']['default_button'] = array(
+      '#type' => 'checkbox',
+      '#title' => $this->t('Enable <i>Display Add another button on node add form</i> for new content types.'),
+      '#default_value' => $config->get('default_button'),
+    );
+    $form['addanother_display']['default_message'] = array(
+      '#type' => 'checkbox',
+      '#title' => $this->t('Enable <i>Display the Add another message after node creation</i> for new content types.'),
+      '#default_value' => $config->get('default_message'),
+    );
+    $form['addanother_display']['default_tab'] = array(
+      '#type' => 'checkbox',
+      '#title' => $this->t('Enable <i>Display the Add another tab</i> for new content types.'),
+      '#default_value' => $config->get('default_tab'),
+    );
+    $form['addanother_display']['default_tab_edit'] = array(
+      '#type' => 'checkbox',
+      '#title' => $this->t('Enable <i>Also display the Add another tab on edit page</i> for new content types.'),
+      '#default_value' => $config->get('default_tab_edit'),
+    );
+
+    return parent::buildForm($form, $form_state);
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function submitForm(array &$form, FormStateInterface $form_state) {
+    $this->config('addanother.settings')
+      ->set('default_button', $form_state->getValue('default_button'))
+      ->set('default_message', $form_state->getValue('default_message'))
+      ->set('default_tab', $form_state->getValue('default_tab'))
+      ->set('default_tab_edit', $form_state->getValue('default_tab_edit'))
+      ->save();
+
+    parent::submitForm($form, $form_state);
+  }
+
+}
diff --git a/src/Tests/AddAnotherTest.php b/src/Tests/AddAnotherTest.php
new file mode 100644
index 0000000..22eeecf
--- /dev/null
+++ b/src/Tests/AddAnotherTest.php
@@ -0,0 +1,82 @@
+<?php
+
+/**
+ * @file
+ * SimpleTest-based functional test for Add another module.
+ */
+
+namespace Drupal\addanother\Tests;
+
+use Drupal\simpletest\WebTestBase;
+
+/**
+ * Tests Addanother functionality.
+ *
+ * @group Addanother
+ */
+class AddAnotherTest extends WebTestBase {
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  static public $modules = array('addanother');
+
+  /**
+   * The installation profile to use with this test.
+   *
+   * @var string
+   */
+  protected $profile = 'minimal';
+
+  /**
+   * Tests Database Logging module functionality through interfaces.
+   *
+   * First creates content type, then logs in users, then creates nodes,
+   * and finally tests Addanother module functionality through user interface.
+   */
+  public function testAddanother() {
+    $node_type = $this->randomMachineName(8);
+    $config = \Drupal::service('config.factory')->getEditable('addanother.settings');
+    $config
+      ->set('button.' . $node_type, TRUE)
+      ->set('message.' . $node_type, TRUE)
+      ->set('tab.' . $node_type, TRUE)
+      ->set('tab_edit.' . $node_type, TRUE)
+      ->save();
+
+    $settings = array(
+      'type' => $node_type,
+      'name' => $node_type,
+    );
+    $this->drupalCreateContentType($settings);
+
+    $web_user = $this->drupalCreateUser(array('bypass node access', 'administer content types', 'use add another', 'administer add another'));
+    $this->drupalLogin($web_user);
+
+    // Create a node.
+    $edit = array();
+    $edit['title[0][value]'] = $this->randomMachineName(8);
+    $edit['body[0][value]'] = $this->randomMachineName(16);
+    $this->drupalPostForm("node/add/$node_type", $edit, t('Save'));
+
+    // Check that the node has been created
+    $this->assertText(t('@post @title has been created.', array(
+      '@post' => $node_type,
+      '@title' => $edit['title[0][value]']
+    )), 'Node created.');
+    $this->assertText(t('You may add another @type.', array('@type' => $node_type)), 'Addanother message was presented.');
+    $this->assertLink('Add another');
+
+    // Create a node.
+    $edit = array();
+    $edit['title[0][value]'] = $this->randomMachineName(8);
+    $edit['body[0][value]'] = $this->randomMachineName(16);
+    $this->drupalPostForm("node/add/$node_type", $edit, t('Save and add another'));
+
+    // Check that the node has been created
+    $this->assertUrl("node/add/$node_type");
+  }
+
+}
