WebformElementReadonlyTest.php in Webform 6.x
File
tests/src/Functional/Element/WebformElementReadonlyTest.php
View source
<?php
namespace Drupal\Tests\webform\Functional\Element;
class WebformElementReadonlyTest extends WebformElementBrowserTestBase {
protected static $testWebforms = [
'test_element_readonly',
];
public function testReadonly() {
$this
->drupalGet('/webform/test_element_readonly');
$this
->assertCssSelect('.js-form-item-textfield.form-item-textfield');
$this
->assertRaw('<input readonly="readonly" data-drupal-selector="edit-textfield" type="text" id="edit-textfield" name="textfield" value="" size="60" maxlength="255" class="form-text" />');
$this
->assertCssSelect('.js-form-item-textarea.form-item-textarea');
$this
->assertRaw('<textarea readonly="readonly" data-drupal-selector="edit-textarea" id="edit-textarea" name="textarea" rows="5" cols="60" class="form-textarea"></textarea>');
}
}