diff --git a/core/modules/editor/src/Tests/EditorUploadImageScaleTest.php b/core/modules/editor/src/Tests/EditorUploadImageScaleTest.php index 16e07d3..c80f10f 100644 --- a/core/modules/editor/src/Tests/EditorUploadImageScaleTest.php +++ b/core/modules/editor/src/Tests/EditorUploadImageScaleTest.php @@ -1,10 +1,5 @@ assertNoRaw(t('The image was resized to fit within the maximum allowed dimensions of %dimensions pixels.', ['%dimensions' => $max_width . 'x' . $max_height])); } + /** + * Gets the dimensions of an uploaded image. + * + * @param string $uri + * The URI of the image. + * + * @return array + */ protected function getTestImageInfo($uri) { $image_file = $this->container->get('image.factory')->get($uri); return [ @@ -126,6 +129,14 @@ protected function getTestImageInfo($uri) { ]; } + /** + * Sets the maximum dimensions and saves the configuration. + * + * @param string|int $width + * The URI of the image. + * @param string|int $height + * The URI of the image. + */ protected function setMaxDimensions($width, $height) { $editor = Editor::load('basic_html'); $image_upload_settings = $editor->getImageUploadSettings(); @@ -135,6 +146,14 @@ protected function setMaxDimensions($width, $height) { $editor->save(); } + /** + * Uploads an image via the editor dialog. + * + * @param string $uri + * The URI of the image. + * + * @return array + */ protected function uploadImage($uri) { $edit = [ 'files[fid]' => drupal_realpath($uri),