HiddenFieldSelector.php

Same filename in other branches
  1. 9 core/tests/Drupal/Tests/HiddenFieldSelector.php
  2. 8.9.x core/tests/Drupal/Tests/HiddenFieldSelector.php
  3. 11.x core/tests/Drupal/Tests/HiddenFieldSelector.php

Namespace

Drupal\Tests

File

core/tests/Drupal/Tests/HiddenFieldSelector.php

View source
<?php

declare (strict_types=1);
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

Title Deprecated Summary
HiddenFieldSelector Extends PartialNamedSelector to allow retrieval of hidden fields.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.