view core/tests/Drupal/Tests/HiddenFieldSelector.php @ 4:a9cd425dd02b

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:11:55 +0000
parents c75dbcec494b
children
line wrap: on
line 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();
  }

}