EditorImageDialog example

'theme' => 'olivero',
        'theme_token' => 'some-token',
        'libraries' => '',
      ],
    ];
    $form_state = (new FormState())
      ->setRequestMethod('POST')
      ->setUserInput($input)
      ->addBuildInfo('args', [$this->editor]);

    $form_builder = $this->container->get('form_builder');
    $form_object = new EditorImageDialog(\Drupal::entityTypeManager()->getStorage('file'));
    $form_id = $form_builder->getFormId($form_object$form_state);
    $form = $form_builder->retrieveForm($form_id$form_state);
    $form_builder->prepareForm($form_id$form$form_state);
    $form_builder->processForm($form_id$form$form_state);

    // Assert these two values are present and we don't get the 'not-this'     // default back.     $this->assertFalse($form_state->getValue(['attributes', 'hasCaption'], 'not-this'));
  }

}
$this->expectDeprecation('Drupal\editor\Form\EditorLinkDialog is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/project/drupal/issues/3291493');
    new EditorLinkDialog();
  }

  /** * Tests the deprecation of the Drupal\editor\Form\EditorImageDialog class. * * @see EditorImageDialog */
  public function testEditorImageDialog(): void {
    $this->expectDeprecation('Drupal\editor\Form\EditorImageDialog is deprecated in drupal:10.1.0 and is removed from drupal:11.0.0. There is no replacement. See https://www.drupal.org/project/drupal/issues/3291493');
    new EditorImageDialog($this->createMock('\Drupal\file\FileStorage'));
  }

}
Home | Imprint | This part of the site doesn't use cookies.