public function WebformUiElementActionsTest::testActionsElements in Webform 6.x
Same name and namespace in other branches
- 8.5 modules/webform_ui/tests/src/Functional/WebformUiElementActionsTest.php \Drupal\Tests\webform_ui\Functional\WebformUiElementActionsTest::testActionsElements()
Tests actions element.
File
- modules/
webform_ui/ tests/ src/ Functional/ WebformUiElementActionsTest.php, line 24
Class
- WebformUiElementActionsTest
- Tests for webform UI actions element.
Namespace
Drupal\Tests\webform_ui\FunctionalCode
public function testActionsElements() {
$this
->drupalLogin($this->rootUser);
$values = [
'id' => 'test',
];
$elements = [
'text_field' => [
'#type' => 'textfield',
'#title' => 'textfield',
],
];
$this
->createWebform($values, $elements);
// Check that submit buttons are customizable.
$this
->drupalGet('/admin/structure/webform/manage/test');
$this
->assertLink('Customize');
// Disable actions element.
\Drupal::configFactory()
->getEditable('webform.settings')
->set('element.excluded_elements.webform_actions', 'webform_actions')
->save();
// Check that submit buttons are not customizable.
$this
->drupalGet('/admin/structure/webform/manage/test');
$this
->assertNoLink('Customize');
}