function AssertContentTrait::cssSelect
Same name and namespace in other branches
- 8.9.x core/tests/Drupal/KernelTests/AssertContentTrait.php \Drupal\KernelTests\AssertContentTrait::cssSelect()
- 10 core/tests/Drupal/KernelTests/AssertContentTrait.php \Drupal\KernelTests\AssertContentTrait::cssSelect()
- 11.x 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.
4 calls to AssertContentTrait::cssSelect()
- ClaroVerticalTabsTest::testVerticalTabs in core/
tests/ Drupal/ KernelTests/ Core/ Theme/ ClaroVerticalTabsTest.php - Confirms that Claro can render vertical tabs correctly.
- CommentAdminViewTest::doTestFilters in core/
modules/ comment/ tests/ src/ Kernel/ Views/ CommentAdminViewTest.php - Tests comment admin view display.
- MediaEmbedFilterDisabledIntegrationsTest::testDisabledIntegrations in core/
modules/ quickedit/ tests/ src/ Kernel/ MediaEmbedFilterDisabledIntegrationsTest.php - @covers ::renderMedia[[api-linebreak]] @covers ::disableContextualLinks[[api-linebreak]]
- RenderCacheIntegrationTest::assertCacheTagsForFieldBasedView in core/
modules/ views/ tests/ src/ Kernel/ RenderCacheIntegrationTest.php - Tests cache tags on output & result cache items for a field-based view.
File
-
core/
tests/ Drupal/ KernelTests/ AssertContentTrait.php, line 245
Class
- AssertContentTrait
- Provides test methods to assert content.
Namespace
Drupal\KernelTestsCode
protected function cssSelect($selector) {
return $this->xpath((new CssSelectorConverter())->toXPath($selector));
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.