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

Breadcrumb

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

function CrawlerSelectorTextContains::matches

Parameters

Crawler $crawler:

Overrides Constraint::matches

File

vendor/symfony/dom-crawler/Test/Constraint/CrawlerSelectorTextContains.php, line 40

Class

CrawlerSelectorTextContains

Namespace

Symfony\Component\DomCrawler\Test\Constraint

Code

protected function matches($crawler) : bool {
    $crawler = $crawler->filter($this->selector);
    if (!\count($crawler)) {
        $this->hasNode = false;
        return false;
    }
    $this->hasNode = true;
    $this->nodeText = $crawler->text(null, true);
    return str_contains($this->nodeText, $this->expectedText);
}

API Navigation

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