You are here

protected function EditorUploadImageScaleTest::getTestImageInfo in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/editor/tests/src/Functional/EditorUploadImageScaleTest.php \Drupal\Tests\editor\Functional\EditorUploadImageScaleTest::getTestImageInfo()
  2. 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\Functional

Code

protected function getTestImageInfo($uri) {
  $image_file = $this->container
    ->get('image.factory')
    ->get($uri);
  return [
    (int) $image_file
      ->getWidth(),
    (int) $image_file
      ->getHeight(),
  ];
}