You are here

public function MigrateImageStylesTest::testImageStylesMigration in Zircon Profile 8

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

Test the image styles migration.

File

core/modules/image/src/Tests/Migrate/d7/MigrateImageStylesTest.php, line 39
Contains \Drupal\image\Tests\Migrate\d7\MigrateImageStylesTest.

Class

MigrateImageStylesTest
Test image styles migration to config entities.

Namespace

Drupal\image\Tests\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,
    ],
    [],
  ]);
  $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',
    ],
  ]);
}