function BlockUiTest::testBlockValidateErrors
Same name in other branches
- 8.9.x core/modules/block/tests/src/Functional/BlockUiTest.php \Drupal\Tests\block\Functional\BlockUiTest::testBlockValidateErrors()
- 10 core/modules/block/tests/src/Functional/BlockUiTest.php \Drupal\Tests\block\Functional\BlockUiTest::testBlockValidateErrors()
- 11.x core/modules/block/tests/src/Functional/BlockUiTest.php \Drupal\Tests\block\Functional\BlockUiTest::testBlockValidateErrors()
Tests if validation errors are passed plugin form to the parent form.
File
-
core/
modules/ block/ tests/ src/ Functional/ BlockUiTest.php, line 355
Class
- BlockUiTest
- Tests that the block configuration UI exists and stores data correctly.
Namespace
Drupal\Tests\block\FunctionalCode
public function testBlockValidateErrors() {
$this->drupalGet('admin/structure/block/add/test_settings_validation/stark');
$this->submitForm([
'region' => 'content',
'settings[digits]' => 'abc',
], 'Save block');
$this->assertSession()
->statusMessageContains('Only digits are allowed', 'error');
$this->assertSession()
->elementExists('xpath', '//div[contains(@class,"form-item-settings-digits")]/input[contains(@class,"error")]');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.