function MigrateImageStylesTest::testImageStylesMigration

Same name in other branches
  1. 9 core/modules/image/tests/src/Kernel/Migrate/d7/MigrateImageStylesTest.php \Drupal\Tests\image\Kernel\Migrate\d7\MigrateImageStylesTest::testImageStylesMigration()
  2. 8.9.x core/modules/image/tests/src/Kernel/Migrate/d7/MigrateImageStylesTest.php \Drupal\Tests\image\Kernel\Migrate\d7\MigrateImageStylesTest::testImageStylesMigration()
  3. 10 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 36

Class

MigrateImageStylesTest
Test image styles migration to config entities.

Namespace

Drupal\Tests\image\Kernel\Migrate\d7

Code

public function testImageStylesMigration() : void {
    $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',
        ],
    ]);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.