diff --git a/core/modules/block/src/Tests/BlockUiTest.php b/core/modules/block/src/Tests/BlockUiTest.php
index 6b55667..0edd591 100644
--- a/core/modules/block/src/Tests/BlockUiTest.php
+++ b/core/modules/block/src/Tests/BlockUiTest.php
@@ -293,4 +293,22 @@ public function testBlockPlacementIndicator() {
     $this->assertUrl('admin/structure/block/list/classy');
   }
 
+  /**
+   * Tests the block settings validations.
+   */
+  public function testBlockValidateErrors() {
+    $url = 'admin/structure/block/add/test_settings_validation/classy';
+    $this->drupalGet($url);
+    $edit = [
+      'settings[only_numbers]' => 'abc'
+    ];
+    $this->drupalPostForm($url, $edit, 'Save block');
+    $arguments = [
+      ':message' => 'Only numbers are allowed',
+    ];
+    $pattern = '//div[contains(@class,"messages messages--error")]/div[contains(text()[2],:message)]';
+    $elements = $this->xpath($pattern, $arguments);
+    $this->assertTrue(!empty($elements), 'The error message appear in the form correctly.');
+  }
+
 }
diff --git a/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestSettingsValidationBlock.php b/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestSettingsValidationBlock.php
new file mode 100644
index 0000000..903fcf4
--- /dev/null
+++ b/core/modules/block/tests/modules/block_test/src/Plugin/Block/TestSettingsValidationBlock.php
@@ -0,0 +1,58 @@
+<?php
+
+/**
+ * @file
+ * Contains Drupal\tfoot\Plugin\Block\test2.
+ */
+
+namespace Drupal\block_test\Plugin\Block;
+
+use Drupal\Core\Block\BlockBase;
+use Drupal\Core\Form\FormStateInterface;
+
+/**
+ * Provides a test settings validation block.
+ *
+ * @Block(
+ *  id = "test_settings_validation",
+ *  admin_label = @Translation("Test settings validation block"),
+ * )
+ */
+class TestSettingsValidationBlock extends BlockBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public function blockForm($form, FormStateInterface $form_state) {
+    $form['only_numbers'] = array(
+      '#type' => 'textfield',
+      '#title' => $this->t('Only numbers'),
+    );
+
+    return $form;
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function blockSubmit($form, FormStateInterface $form_state) {
+    $this->configuration['only_numbers'] = $form_state->getValue('only_numbers');
+  }
+
+  public function blockValidate($form, FormStateInterface $form_state) {
+    $value = $form_state->getValue('only_numbers');
+
+    if (!is_numeric($value)) {
+      $form_state->setErrorByName('only_numbers', t('Only numbers are allowed'));
+    }
+  }
+
+  /**
+   * {@inheritdoc}
+   */
+  public function build() {
+    return array(
+      '#children' => $this->configuration['only_numbers'],
+    );
+  }
+}
