Commit 961bf74b authored by webchick's avatar webchick

Issue #2558927 by quietone, phenaproxima, lostkangaroo, anavarre:...

Issue #2558927 by quietone, phenaproxima, lostkangaroo, anavarre: d6_imagecache_presets reports failure for missing table
parent 6aea117e
......@@ -14,7 +14,8 @@
* Drupal 6 imagecache presets source from database.
*
* @MigrateSource(
* id = "d6_imagecache_presets"
* id = "d6_imagecache_presets",
* source_provider = "imagecache"
* )
*/
class ImageCachePreset extends DrupalSqlBase {
......
......@@ -9,11 +9,13 @@
use Drupal\Core\Database\Database;
use Drupal\image\Entity\ImageStyle;
use Drupal\migrate\Entity\Migration;
use Drupal\migrate\Entity\MigrationInterface;
use Drupal\migrate\Exception\RequirementsException;
use Drupal\migrate_drupal\Tests\d6\MigrateDrupal6TestBase;
/**
* Migrate ImageCache presets to Image styles
* Tests migration of ImageCache presets to image styles.
*
* @group image
*/
......@@ -27,6 +29,29 @@ public function setUp() {
$this->installConfig(['image']);
}
/**
* Tests that an exception is thrown when ImageCache is not installed.
*/
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());
}
}
/**
* Test basic passing migrations.
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment