function MigrateImageCacheTest::testInvalidCropValues

Same name in other branches
  1. 9 core/modules/image/tests/src/Kernel/Migrate/d6/MigrateImageCacheTest.php \Drupal\Tests\image\Kernel\Migrate\d6\MigrateImageCacheTest::testInvalidCropValues()
  2. 8.9.x core/modules/image/tests/src/Kernel/Migrate/d6/MigrateImageCacheTest.php \Drupal\Tests\image\Kernel\Migrate\d6\MigrateImageCacheTest::testInvalidCropValues()
  3. 11.x core/modules/image/tests/src/Kernel/Migrate/d6/MigrateImageCacheTest.php \Drupal\Tests\image\Kernel\Migrate\d6\MigrateImageCacheTest::testInvalidCropValues()

Tests that missing action's causes failures.

File

core/modules/image/tests/src/Kernel/Migrate/d6/MigrateImageCacheTest.php, line 115

Class

MigrateImageCacheTest
Tests migration of ImageCache presets to image styles.

Namespace

Drupal\Tests\image\Kernel\Migrate\d6

Code

public function testInvalidCropValues() : void {
    Database::getConnection('default', 'migrate')->insert("imagecache_action")
        ->fields([
        'presetid',
        'weight',
        'module',
        'action',
        'data',
    ])
        ->values([
        'presetid' => '1',
        'weight' => '0',
        'module' => 'imagecache',
        'action' => 'imagecache_crop',
        'data' => serialize([
            'xoffset' => '10',
            'yoffset' => '10',
        ]),
    ])
        ->execute();
    $this->startCollectingMessages();
    $this->executeMigration('d6_imagecache_presets');
    $this->assertEquals([
        'error' => [
            'The Drupal 8 image crop effect does not support numeric values for x and y offsets. Use keywords to set crop effect offsets instead.',
        ],
    ], $this->migrateMessages);
}

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