You are here

public function MigrateImageCacheTest::testMissingTable 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::testMissingTable()

Tests that an exception is thrown when ImageCache is not installed.

File

core/modules/image/src/Tests/Migrate/d6/MigrateImageCacheTest.php, line 35
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 testMissingTable() {
  $this->sourceDatabase
    ->update('system')
    ->fields(array(
    'status' => 0,
  ))
    ->condition('name', 'imagecache')
    ->condition('type', 'module')
    ->execute();
  try {
    Migration::load('d6_imagecache_presets')
      ->getSourcePlugin()
      ->checkRequirements();
    $this
      ->fail('Did not catch expected RequirementsException.');
  } catch (RequirementsException $e) {
    $this
      ->pass('Caught expected RequirementsException: ' . $e
      ->getMessage());
  }
}