You are here

protected function AssertContentTrait::cssSelect in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/AssertContentTrait.php \Drupal\KernelTests\AssertContentTrait::cssSelect()
  2. 9 core/tests/Drupal/KernelTests/AssertContentTrait.php \Drupal\KernelTests\AssertContentTrait::cssSelect()

Searches elements using a CSS selector in the raw content.

The search is relative to the root element (HTML tag normally) of the page.

Parameters

string $selector: CSS selector to use in the search.

Return value

\SimpleXMLElement[] The return value of the XPath search performed after converting the CSS selector to an XPath selector.

1 call to AssertContentTrait::cssSelect()
CommentAdminViewTest::doTestFilters in core/modules/comment/tests/src/Kernel/Views/CommentAdminViewTest.php
Tests comment admin view display.

File

core/tests/Drupal/KernelTests/AssertContentTrait.php, line 235

Class

AssertContentTrait
Provides test methods to assert content.

Namespace

Drupal\KernelTests

Code

protected function cssSelect($selector) {
  return $this
    ->xpath((new CssSelectorConverter())
    ->toXPath($selector));
}