You are here

protected function MigrateImageCacheTest::assertImageEffect 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::assertImageEffect()

Assert that a given image effect is migrated.

Parameters

array $collection: Collection of effects

$id: Id that should exist in the collection.

$config: Expected configuration for the collection.

Return value

bool

1 call to MigrateImageCacheTest::assertImageEffect()
MigrateImageCacheTest::testPassingMigration in core/modules/image/src/Tests/Migrate/d6/MigrateImageCacheTest.php
Test basic passing migrations.

File

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

Class

MigrateImageCacheTest
Tests migration of ImageCache presets to image styles.

Namespace

Drupal\image\Tests\Migrate\d6

Code

protected function assertImageEffect($collection, $id, $config) {

  /** @var \Drupal\image\ConfigurableImageEffectBase $effect */
  foreach ($collection as $key => $effect) {
    $effect_config = $effect
      ->getConfiguration();
    if ($effect_config['id'] == $id && $effect_config['data'] == $config) {

      // We found this effect so succeed and return.
      return $this
        ->pass('Effect ' . $id . ' imported correctly');
    }
  }

  // The loop did not find the effect so we it was not imported correctly.
  return $this
    ->fail('Effect ' . $id . ' did not import correctly');
}