protected function EditorUploadImageScaleTest::getTestImageInfo in Drupal 9
Same name and namespace in other branches
- 8 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.
1 call to EditorUploadImageScaleTest::getTestImageInfo()
- 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 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(),
];
}