You are here

public function MigrateImageStylesTest::testImageStylesMigration in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/image/tests/src/Kernel/Migrate/d7/MigrateImageStylesTest.php \Drupal\Tests\image\Kernel\Migrate\d7\MigrateImageStylesTest::testImageStylesMigration()

Tests the image styles migration.

File

core/modules/image/tests/src/Kernel/Migrate/d7/MigrateImageStylesTest.php, line 34

Class

MigrateImageStylesTest
Test image styles migration to config entities.

Namespace

Drupal\Tests\image\Kernel\Migrate\d7

Code

public function testImageStylesMigration() {
  $this
    ->assertEntity('custom_image_style_1', "Custom image style 1", [
    'image_scale_and_crop',
    'image_desaturate',
  ], [
    [
      'width' => 55,
      'height' => 55,
      'anchor' => 'center-center',
    ],
    [],
  ]);
  $this
    ->assertEntity('custom_image_style_2', "Custom image style 2", [
    'image_resize',
    'image_rotate',
  ], [
    [
      'width' => 55,
      'height' => 100,
    ],
    [
      'degrees' => 45,
      'bgcolor' => '#FFFFFF',
      'random' => FALSE,
    ],
  ]);
  $this
    ->assertEntity('custom_image_style_3', "Custom image style 3", [
    'image_scale',
    'image_crop',
  ], [
    [
      'width' => 150,
      'height' => NULL,
      'upscale' => FALSE,
    ],
    [
      'width' => 50,
      'height' => 50,
      'anchor' => 'left-top',
    ],
  ]);
}