You are here

WebformElementReadonlyTest.php in Webform 6.x

Same filename and directory in other branches
  1. 8.5 tests/src/Functional/Element/WebformElementReadonlyTest.php

File

tests/src/Functional/Element/WebformElementReadonlyTest.php
View source
<?php

namespace Drupal\Tests\webform\Functional\Element;


/**
 * Tests for webform element readonly attribute.
 *
 * @group webform
 */
class WebformElementReadonlyTest extends WebformElementBrowserTestBase {

  /**
   * Webforms to load.
   *
   * @var array
   */
  protected static $testWebforms = [
    'test_element_readonly',
  ];

  /**
   * Tests 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>');
  }

}

Classes

Namesort descending Description
WebformElementReadonlyTest Tests for webform element readonly attribute.