You are here

HiddenFieldSelector.php in Drupal 8

Namespace

Drupal\Tests

File

core/tests/Drupal/Tests/HiddenFieldSelector.php
View source
<?php

namespace Drupal\Tests;

use Behat\Mink\Selector\PartialNamedSelector;

/**
 * Extends PartialNamedSelector to allow retrieval of hidden fields.
 *
 * @see \Behat\Mink\Selector\PartialNamedSelector
 */
class HiddenFieldSelector extends PartialNamedSelector {

  /**
   * {@inheritdoc}
   */
  public function __construct() {
    $xpath = ".//input[%lowercaseType% = 'hidden' and (%idOrNameMatch% or %valueMatch%)]";
    $this
      ->registerNamedXpath('hidden_field', $xpath);
    parent::__construct();
  }

}

Classes

Namesort descending Description
HiddenFieldSelector Extends PartialNamedSelector to allow retrieval of hidden fields.