HiddenFieldSelector.php 512 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace Drupal\Tests;
  3. use Behat\Mink\Selector\PartialNamedSelector;
  4. /**
  5. * Extends PartialNamedSelector to allow retrieval of hidden fields.
  6. *
  7. * @see \Behat\Mink\Selector\PartialNamedSelector
  8. */
  9. class HiddenFieldSelector extends PartialNamedSelector {
  10. /**
  11. * {@inheritdoc}
  12. */
  13. public function __construct() {
  14. $xpath = ".//input[%lowercaseType% = 'hidden' and (%idOrNameMatch% or %valueMatch%)]";
  15. $this->registerNamedXpath('hidden_field', $xpath);
  16. parent::__construct();
  17. }
  18. }