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

Breadcrumb

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

function WebAssert::getMatchingElementRepresentation

Parameters

string $selectorType:

string|array $selector:

bool $plural:

Return value

string

10 calls to WebAssert::getMatchingElementRepresentation()
WebAssert::elementAttributeContains in vendor/behat/mink/src/WebAssert.php
Checks that an attribute of a specific elements contains text.
WebAssert::elementAttributeExists in vendor/behat/mink/src/WebAssert.php
Checks that an attribute exists in an element.
WebAssert::elementAttributeNotContains in vendor/behat/mink/src/WebAssert.php
Checks that an attribute of a specific elements does not contain text.
WebAssert::elementAttributeNotExists in vendor/behat/mink/src/WebAssert.php
Checks that an attribute does not exist in an element.
WebAssert::elementContains in vendor/behat/mink/src/WebAssert.php
Checks that specific element contains HTML.

... See full list

File

vendor/behat/mink/src/WebAssert.php, line 957

Class

WebAssert
Mink web assertions tool.

Namespace

Behat\Mink

Code

private function getMatchingElementRepresentation(string $selectorType, $selector, bool $plural = false) : string {
    $pluralization = $plural ? 's' : '';
    if (in_array($selectorType, array(
        'named',
        'named_exact',
        'named_partial',
    )) && is_array($selector) && 2 === count($selector)) {
        return sprintf('%s%s matching locator "%s"', $selector[0], $pluralization, $selector[1]);
    }
    if (is_array($selector)) {
        $selector = implode(' ', $selector);
    }
    return sprintf('element%s matching %s "%s"', $pluralization, $selectorType, $selector);
}

API Navigation

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