protected function EntityEmbedFilterTestBase::assertHasAttributes in Entity Embed 8
Assert that the SimpleXMLElement object has the given attributes.
Parameters
\SimpleXMLElement $element: The SimpleXMLElement object to check.
array $attributes: An array of attributes.
8 calls to EntityEmbedFilterTestBase::assertHasAttributes()
- EntityEmbedFilterLegacyTest::testEntityEmbedDisplayDefaultBackwardsCompatibility in tests/
src/ Kernel/ EntityEmbedFilterLegacyTest.php - Tests BC for `data-entity-embed-display="default"`.
- EntityEmbedFilterLegacyTest::testEntityIdBackwardsCompatibility in tests/
src/ Kernel/ EntityEmbedFilterLegacyTest.php - Tests BC for `data-entity-uuid`'s predecessor, `data-entity-id`.
- EntityEmbedFilterLegacyTest::testEntityIdIgnoredIfEntityUuidPresent in tests/
src/ Kernel/ EntityEmbedFilterLegacyTest.php - Verifies `data-entity-id` is ignored when `data-entity-uuid` is present.
- EntityEmbedFilterOverridesTest::testOverrideAltAndTitleForImage in tests/
src/ Kernel/ EntityEmbedFilterOverridesTest.php - Tests overriding of `alt` and `title` for default image field formatter.
- EntityEmbedFilterOverridesTest::testOverridesAltAndTitleForImageMedia in tests/
src/ Kernel/ EntityEmbedFilterOverridesTest.php - Tests overriding of `alt` and `title` for image media items.
File
- tests/
src/ Kernel/ EntityEmbedFilterTestBase.php, line 143
Class
- EntityEmbedFilterTestBase
- Base class for Entity Embed filter tests.
Namespace
Drupal\Tests\entity_embed\KernelCode
protected function assertHasAttributes(\SimpleXMLElement $element, array $attributes) {
foreach ($attributes as $attribute => $value) {
$this
->assertSame((string) $value, (string) $element[$attribute]);
}
}