Same name and namespace in other branches
  1. 8.9.x 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.

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 168

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(),
  ];
}