WebformElementAttributesTest.php in Webform 6.x
File
tests/src/Functional/Element/WebformElementAttributesTest.php
View source
<?php
namespace Drupal\Tests\webform\Functional\Element;
class WebformElementAttributesTest extends WebformElementBrowserTestBase {
protected static $testWebforms = [
'test_element_attributes',
];
public function testAttributes() {
$this
->drupalGet('/webform/test_element_attributes');
$this
->assertFieldByName('webform_element_attributes[class][other]', 'four five');
$this
->assertFieldByName('webform_element_attributes_no_classes[class]', 'one two four five');
$this
->drupalPostForm('/webform/test_element_attributes', [], 'Submit');
$this
->assertRaw("webform_element_attributes:\n class:\n - one\n - two\n - four\n - five\n style: 'color: red'\n custom: test\nwebform_element_attributes_no_classes:\n class:\n - one\n - two\n - four\n - five");
}
}