function AssertContentTrait::cssSelect
Same name and namespace in other branches
- 11.x core/tests/Drupal/KernelTests/AssertContentTrait.php \Drupal\KernelTests\AssertContentTrait::cssSelect()
- 10 core/tests/Drupal/KernelTests/AssertContentTrait.php \Drupal\KernelTests\AssertContentTrait::cssSelect()
- 8.9.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.
7 calls to AssertContentTrait::cssSelect()
- MediaEmbedFilterDisabledIntegrationsTest::testDisabledIntegrations in core/
modules/ media/ tests/ src/ Kernel/ MediaEmbedFilterDisabledIntegrationsTest.php - @covers ::renderMedia[[api-linebreak]] @covers ::disableContextualLinks[[api-linebreak]]
- MediaEmbedFilterTest::testAccessUnpublished in core/
modules/ media/ tests/ src/ Kernel/ MediaEmbedFilterTest.php - Tests that entity access is respected by embedding an unpublished entity.
- MediaEmbedFilterTest::testBasics in core/
modules/ media/ tests/ src/ Kernel/ MediaEmbedFilterTest.php - Ensures media entities are rendered correctly.
- MediaEmbedFilterTest::testFilterIntegration in core/
modules/ media/ tests/ src/ Kernel/ MediaEmbedFilterTest.php - @covers \Drupal\filter\Plugin\Filter\FilterAlign[[api-linebreak]] @covers \Drupal\filter\Plugin\Filter\FilterCaption[[api-linebreak]] @dataProvider providerFilterIntegration
- MediaEmbedFilterTest::testMissingEntityIndicator in core/
modules/ media/ tests/ src/ Kernel/ MediaEmbedFilterTest.php - Tests the indicator for missing entities.
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.