function MediaTest::assertSourceAttributeSame
Same name in this branch
- 9 core/modules/ckeditor5/tests/src/FunctionalJavascript/MediaTest.php \Drupal\Tests\ckeditor5\FunctionalJavascript\MediaTest::assertSourceAttributeSame()
Verifies value of an attribute on the downcast <drupal-media> element.
Assumes CKEditor is in source mode.
@internal
Parameters
string $attribute: The attribute to check.
string|null $value: Either a string value or if NULL, asserts that <drupal-media> element doesn't have the attribute.
2 calls to MediaTest::assertSourceAttributeSame()
- MediaTest::testAlignment in core/
modules/ ckeditor/ tests/ src/ FunctionalJavascript/ MediaTest.php - Tests alignment integration.
- MediaTest::testAlt in core/
modules/ ckeditor/ tests/ src/ FunctionalJavascript/ MediaTest.php - Tests the EditorMediaDialog can set the alt attribute.
File
-
core/
modules/ ckeditor/ tests/ src/ FunctionalJavascript/ MediaTest.php, line 1433
Class
- MediaTest
- @coversDefaultClass \Drupal\ckeditor\Plugin\CKEditorPlugin\DrupalMedia @group ckeditor @group legacy
Namespace
Drupal\Tests\ckeditor\FunctionalJavascriptCode
protected function assertSourceAttributeSame(string $attribute, ?string $value) : void {
$this->assertNotEmpty($drupal_media = $this->getDrupalMediaFromSource());
if ($value === NULL) {
$this->assertFalse($drupal_media->hasAttribute($attribute));
}
else {
$this->assertSame($value, $drupal_media->getAttribute($attribute));
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.