function ImageTestBase::imageAttributesAsString

Same name and namespace in other branches
  1. 10 core/modules/ckeditor5/tests/src/FunctionalJavascript/ImageTestBase.php \Drupal\Tests\ckeditor5\FunctionalJavascript\ImageTestBase::imageAttributesAsString()
  2. 11.x core/modules/ckeditor5/tests/src/FunctionalJavascript/ImageTestBase.php \Drupal\Tests\ckeditor5\FunctionalJavascript\ImageTestBase::imageAttributesAsString()

Helper to format attributes.

Parameters

bool $reverse: Reverse attributes when printing them.

Return value

string

7 calls to ImageTestBase::imageAttributesAsString()
ImageTestBase::testAlignment in core/modules/ckeditor5/tests/src/FunctionalJavascript/ImageTestBase.php
Tests alignment integration.
ImageTestBase::testAltTextRequired in core/modules/ckeditor5/tests/src/FunctionalJavascript/ImageTestBase.php
Tests that alt text is required for images.
ImageTestBase::testAttributeRetentionDuringUpcasting in core/modules/ckeditor5/tests/src/FunctionalJavascript/ImageTestBase.php
Ensures that attributes are retained on conversion.
ImageTestBase::testImageArbitraryHtml in core/modules/ckeditor5/tests/src/FunctionalJavascript/ImageTestBase.php
Tests that arbitrary attributes are allowed via GHS.
ImageTestBase::testImageCaption in core/modules/ckeditor5/tests/src/FunctionalJavascript/ImageTestBase.php
Ensures that images can have caption set.

... See full list

File

core/modules/ckeditor5/tests/src/FunctionalJavascript/ImageTestBase.php, line 69

Class

ImageTestBase
@coversDefaultClass <a href="/api/drupal/core%21modules%21ckeditor5%21src%21Plugin%21CKEditor5Plugin%21Image.php/class/Image/9" title="CKEditor 5 Image plugin." class="local">\Drupal\ckeditor5\Plugin\CKEditor5Plugin\Image</a> @group ckeditor5 @internal

Namespace

Drupal\Tests\ckeditor5\FunctionalJavascript

Code

protected function imageAttributesAsString($reverse = FALSE) {
    $string = [];
    foreach ($this->imageAttributes() as $key => $value) {
        $string[] = $key . '="' . $value . '"';
    }
    if ($reverse) {
        $string = array_reverse($string);
    }
    return implode(' ', $string);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.