function AssertContentTrait::setRawContent
Same name and namespace in other branches
- 11.x core/tests/Drupal/KernelTests/AssertContentTrait.php \Drupal\KernelTests\AssertContentTrait::setRawContent()
- 10 core/tests/Drupal/KernelTests/AssertContentTrait.php \Drupal\KernelTests\AssertContentTrait::setRawContent()
- 8.9.x core/tests/Drupal/KernelTests/AssertContentTrait.php \Drupal\KernelTests\AssertContentTrait::setRawContent()
Sets the raw content (e.g. HTML).
Parameters
string $content: The raw content to set.
6 calls to AssertContentTrait::setRawContent()
- FieldDisplayTest::testFieldVisualHidden in core/
modules/ field/ tests/ src/ Kernel/ FieldDisplayTest.php - Tests that visually hidden works with core.
- 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.
- MediaEmbedFilterTestBase::applyFilter in core/
modules/ media/ tests/ src/ Kernel/ MediaEmbedFilterTestBase.php - Applies the `@Filter=media_embed` filter to text, pipes to raw content.
- MediaEmbedFilterTranslationTest::testTranslationSelection in core/
modules/ media/ tests/ src/ Kernel/ MediaEmbedFilterTranslationTest.php - Tests that the expected embedded media entity translation is selected.
File
-
core/
tests/ Drupal/ KernelTests/ AssertContentTrait.php, line 60
Class
- AssertContentTrait
- Provides test methods to assert content.
Namespace
Drupal\KernelTestsCode
protected function setRawContent($content) {
$this->content = $content;
$this->plainTextContent = NULL;
$this->elements = NULL;
$this->drupalSettings = [];
if (preg_match('@<script type="application/json" data-drupal-selector="drupal-settings-json">([^<]*)</script>@', $content, $matches)) {
$this->drupalSettings = Json::decode($matches[1]);
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.