protected function EditorUploadImageScaleTest::setMaxDimensions in Drupal 8
Same name and namespace in other branches
- 9 core/modules/editor/tests/src/Functional/EditorUploadImageScaleTest.php \Drupal\Tests\editor\Functional\EditorUploadImageScaleTest::setMaxDimensions()
Sets the maximum dimensions and saves the configuration.
Parameters
string|int $width: The width of the image.
string|int $height: The height of the image.
1 call to EditorUploadImageScaleTest::setMaxDimensions()
- EditorUploadImageScaleTest::testEditorUploadImageScale in core/
modules/ editor/ tests/ src/ Functional/ EditorUploadImageScaleTest.php - Tests scaling of inline images.
File
- core/
modules/ editor/ tests/ src/ Functional/ EditorUploadImageScaleTest.php, line 183
Class
- EditorUploadImageScaleTest
- Tests scaling of inline images.
Namespace
Drupal\Tests\editor\FunctionalCode
protected function setMaxDimensions($width, $height) {
$editor = Editor::load('basic_html');
$image_upload_settings = $editor
->getImageUploadSettings();
$image_upload_settings['max_dimensions']['width'] = $width;
$image_upload_settings['max_dimensions']['height'] = $height;
$editor
->setImageUploadSettings($image_upload_settings);
$editor
->save();
}