function CKEditor5ValidationTestTrait::validatePairToViolationsArray

Same name in other branches
  1. 9 core/modules/ckeditor5/tests/src/Kernel/CKEditor5ValidationTestTrait.php \Drupal\Tests\ckeditor5\Kernel\CKEditor5ValidationTestTrait::validatePairToViolationsArray()
  2. 10 core/modules/ckeditor5/tests/src/Kernel/CKEditor5ValidationTestTrait.php \Drupal\Tests\ckeditor5\Kernel\CKEditor5ValidationTestTrait::validatePairToViolationsArray()

Decorator for CKEditor5::validatePair() that returns an assertable array.

Parameters

\Drupal\editor\EditorInterface $text_editor: The paired text editor to validate.

\Drupal\filter\FilterFormatInterface $text_format: The paired text format to validate.

bool $all_compatibility_problems: Only fundamental compatibility violations are returned unless TRUE.

Return value

array An array with property paths as keys and violation messages as values.

See also

\Drupal\ckeditor5\Plugin\Editor\CKEditor5::validatePair

3 calls to CKEditor5ValidationTestTrait::validatePairToViolationsArray()
SmartDefaultSettingsTest::test in core/modules/ckeditor5/tests/src/Kernel/SmartDefaultSettingsTest.php
Tests the CKEditor 5 default settings conversion.
ValidatorsTest::testMultipleHtmlRestrictingFilters in core/modules/ckeditor5/tests/src/Kernel/ValidatorsTest.php
Tests that validation works with >1 enabled HTML restrictor filters.
ValidatorsTest::testPair in core/modules/ckeditor5/tests/src/Kernel/ValidatorsTest.php
@covers \Drupal\ckeditor5\Plugin\Validation\Constraint\SourceEditingPreventSelfXssConstraintValidator @dataProvider providerPair

File

core/modules/ckeditor5/tests/src/Kernel/CKEditor5ValidationTestTrait.php, line 32

Class

CKEditor5ValidationTestTrait
Defines a trait for testing CKEditor 5 validity.

Namespace

Drupal\Tests\ckeditor5\Kernel

Code

private function validatePairToViolationsArray(EditorInterface $text_editor, FilterFormatInterface $text_format, bool $all_compatibility_problems) : array {
    $violations = CKEditor5::validatePair($text_editor, $text_format, $all_compatibility_problems);
    return self::violationsToArray($violations);
}

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