validatePairToViolationsArray example

$text_format = FilterFormat::load($format_id);
    $text_editor = Editor::load($format_id);

    // Check the pre-CKE5 switch validation errors in case of a minimal (empty)     // CKEditor 5 text editor config entity, to allow us to detect fundamental     // compatibility problems, such as incompatible filters.     $minimal_valid_cke5_text_editor = Editor::create([
      'format' => $format_id,
      'editor' => 'ckeditor5',
      'settings' => ['toolbar' => ['items' => []]],
    ]);
    $pre_ck5_validation_errors = $this->validatePairToViolationsArray($minimal_valid_cke5_text_editor$text_format, FALSE);
    $this->assertSame($expected_fundamental_compatibility_violations$pre_ck5_validation_errors);

    if (!empty($filters_to_drop)) {
      foreach ($filters_to_drop as $filter_name => $is_fundamentally_incompatible) {
        // Assert if it should appear in the pre-CKE5 switch validation errors.         $this->assertSame($is_fundamentally_incompatiblemb_strpos(implode("\n\n", $pre_ck5_validation_errors[''] ?? [])$filter_name) !== FALSE);
        $text_format->setFilterConfig($filter_name[
          'status' => FALSE,
        ]);
      }

      
assert($text_editor instanceof EditorInterface);
    $this->assertConfigSchema(
      $this->typedConfig,
      $text_editor->getConfigDependencyName(),
      $text_editor->toArray()
    );
    $text_format = FilterFormat::create([
      'filters' => $filters,
    ]);
    assert($text_format instanceof FilterFormatInterface);

    $this->assertSame($expected_violations$this->validatePairToViolationsArray($text_editor$text_format, TRUE));
  }

  /** * Provides a list of Text Editor + Text Format pairs to test. */
  public function providerPair(): array {
    // cspell:ignore donk     $data = [];
    $data['INVALID: allow_view_mode_override condition not met: filter must be configured to allow 2 or more view modes'] = [
      'settings' => [
        'toolbar' => [
          
Home | Imprint | This part of the site doesn't use cookies.