Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. NamedSelector.php

NamedSelector::$replacements

Type: array

File

vendor/behat/mink/src/Selector/NamedSelector.php, line 25

Class

NamedSelector
Named selectors engine. Uses registered XPath selectors to create new expressions.

Namespace

Behat\Mink\Selector

Code

private $replacements = array(
    // simple replacements
'%lowercaseType%' => "translate(./@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')",
    '%lowercaseRole%' => "translate(./@role, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz')",
    '%tagTextMatch%' => 'contains(normalize-space(string(.)), %locator%)',
    '%labelTextMatch%' => './@id = //label[%tagTextMatch%]/@for',
    '%idMatch%' => './@id = %locator%',
    '%valueMatch%' => 'contains(./@value, %locator%)',
    '%idOrValueMatch%' => '(%idMatch% or %valueMatch%)',
    '%idOrNameMatch%' => '(%idMatch% or ./@name = %locator%)',
    '%placeholderMatch%' => './@placeholder = %locator%',
    '%titleMatch%' => 'contains(./@title, %locator%)',
    '%altMatch%' => 'contains(./@alt, %locator%)',
    '%relMatch%' => 'contains(./@rel, %locator%)',
    '%labelAttributeMatch%' => 'contains(./@label, %locator%)',
    // complex replacements
'%inputTypeWithoutPlaceholderFilter%' => "%lowercaseType% = 'radio' or %lowercaseType% = 'checkbox' or %lowercaseType% = 'file'",
    '%fieldFilterWithPlaceholder%' => 'self::input[not(%inputTypeWithoutPlaceholderFilter%)] | self::textarea',
    '%fieldMatchWithPlaceholder%' => '(%idOrNameMatch% or %labelTextMatch% or %placeholderMatch%)',
    '%fieldMatchWithoutPlaceholder%' => '(%idOrNameMatch% or %labelTextMatch%)',
    '%fieldFilterWithoutPlaceholder%' => 'self::input[%inputTypeWithoutPlaceholderFilter%] | self::select',
    '%buttonTypeFilter%' => "%lowercaseType% = 'submit' or %lowercaseType% = 'image' or %lowercaseType% = 'button' or %lowercaseType% = 'reset'",
    '%notFieldTypeFilter%' => "not(%buttonTypeFilter% or %lowercaseType% = 'hidden')",
    '%buttonMatch%' => '%idOrNameMatch% or %valueMatch% or %titleMatch%',
    '%linkMatch%' => '(%idMatch% or %tagTextMatch% or %titleMatch% or %relMatch%)',
    '%imgAltMatch%' => './/img[%altMatch%]',
);

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal