protected function EditorUploadImageScaleTest::getTestImageInfo in Drupal 10
Same name and namespace in other branches
- 8 core/modules/editor/tests/src/Functional/EditorUploadImageScaleTest.php \Drupal\Tests\editor\Functional\EditorUploadImageScaleTest::getTestImageInfo()
- 9 core/modules/editor/tests/src/Functional/EditorUploadImageScaleTest.php \Drupal\Tests\editor\Functional\EditorUploadImageScaleTest::getTestImageInfo()
Gets the dimensions of an uploaded image.
Parameters
string $uri: The URI of the image.
Return value
array An array containing the uploaded image's width and height.
File
- core/
modules/ editor/ tests/ src/ Functional/ EditorUploadImageScaleTest.php, line 166
Class
- EditorUploadImageScaleTest
- Tests scaling of inline images.
Namespace
Drupal\Tests\editor\FunctionalCode
protected function getTestImageInfo($uri) {
$image_file = $this->container
->get('image.factory')
->get($uri);
return [
(int) $image_file
->getWidth(),
(int) $image_file
->getHeight(),
];
}