diff --git a/core/modules/image/image.module b/core/modules/image/image.module index e6c4cad..ee49d75 100644 --- a/core/modules/image/image.module +++ b/core/modules/image/image.module @@ -6,6 +6,7 @@ */ use Drupal\Core\Entity\EntityInterface; +use Drupal\Core\Form\FormStateInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\file\Entity\File; use Drupal\field\FieldStorageConfigInterface; diff --git a/core/modules/image/tests/src/Kernel/EditorImageStyleDialogTest.php b/core/modules/image/tests/src/Kernel/EditorImageStyleDialogTest.php index 9b9d7dc..708ad5c 100644 --- a/core/modules/image/tests/src/Kernel/EditorImageStyleDialogTest.php +++ b/core/modules/image/tests/src/Kernel/EditorImageStyleDialogTest.php @@ -3,7 +3,6 @@ namespace Drupal\Tests\image\Kernel; use Drupal\Core\Form\FormState; -use Drupal\Core\Render\RendererInterface; use Drupal\Core\Render\RenderContext; use Drupal\editor\Entity\Editor; use Drupal\editor\Form\EditorImageDialog; @@ -21,11 +20,11 @@ class EditorImageStyleDialogTest extends EntityKernelTestBase { /** - * Filter format for testing. + * Editor for testing. * - * @var \Drupal\filter\FilterFormatInterface + * @var \Drupal\editor\EditorInterface */ - protected $format; + protected $editor; /** * Modules to enable. @@ -56,7 +55,7 @@ protected function setUp() { $this->installConfig(['node']); // Add text formats. - $this->format = FilterFormat::create([ + $format = FilterFormat::create([ 'format' => 'filtered_html', 'name' => 'Filtered HTML', 'weight' => 0, @@ -64,10 +63,10 @@ protected function setUp() { 'filter_image_style' => ['status' => TRUE] ], ]); - $this->format->save(); + $format->save(); // Set up text editor. - $editor = Editor::create([ + $this->editor = Editor::create([ 'format' => 'filtered_html', 'editor' => 'ckeditor', 'image_upload' => [ @@ -77,7 +76,7 @@ protected function setUp() { 'status' => TRUE, ], ]); - $editor->save(); + $this->editor->save(); // Install the image module config so we have the medium image style. $this->installConfig('image'); @@ -119,8 +118,9 @@ public function testEditorImageStyleDialog() { $form_state = (new FormState()) ->setRequestMethod('POST') ->setUserInput($input) - ->addBuildInfo('args', [$this->format]); + ->addBuildInfo('args', [$this->editor]); + /** @var \Drupal\Core\Form\FormBuilderInterface $form_builder */ $form_builder = $this->container->get('form_builder'); $form_object = new EditorImageDialog(\Drupal::entityTypeManager()->getStorage('file')); $form_id = $form_builder->getFormId($form_object, $form_state); diff --git a/core/profiles/standard/config/install/filter.format.basic_html.yml b/core/profiles/standard/config/install/filter.format.basic_html.yml index ece1a15..1c38622 100644 --- a/core/profiles/standard/config/install/filter.format.basic_html.yml +++ b/core/profiles/standard/config/install/filter.format.basic_html.yml @@ -3,6 +3,7 @@ status: true dependencies: module: - editor + - image name: 'Basic HTML' format: basic_html weight: 0 diff --git a/core/profiles/standard/config/install/filter.format.full_html.yml b/core/profiles/standard/config/install/filter.format.full_html.yml index c23da46..07c7e27 100644 --- a/core/profiles/standard/config/install/filter.format.full_html.yml +++ b/core/profiles/standard/config/install/filter.format.full_html.yml @@ -3,6 +3,7 @@ status: true dependencies: module: - editor + - image name: 'Full HTML' format: full_html weight: 1