You are here

public function MigrateImageCacheTest::testInvalidCropValues in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/image/src/Tests/Migrate/d6/MigrateImageCacheTest.php \Drupal\image\Tests\Migrate\d6\MigrateImageCacheTest::testInvalidCropValues()

Test that missing action's causes failures.

File

core/modules/image/src/Tests/Migrate/d6/MigrateImageCacheTest.php, line 128
Contains \Drupal\image\Tests\Migrate\d6\MigrateImageCacheTest.

Class

MigrateImageCacheTest
Tests migration of ImageCache presets to image styles.

Namespace

Drupal\image\Tests\Migrate\d6

Code

public function testInvalidCropValues() {
  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
    ->assertEqual([
    '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);
}