public function DrushTest::testFailingRollbackThrowsException in Migrate Tools 8.5
Same name and namespace in other branches
- 8.4 tests/src/Kernel/DrushTest.php \Drupal\Tests\migrate_tools\Kernel\DrushTest::testFailingRollbackThrowsException()
Tests that a failing rollback throws an exception (i.e. exit code).
File
- tests/
src/ Kernel/ DrushTest.php, line 207
Class
- DrushTest
- Tests for the Drush 9 commands.
Namespace
Drupal\Tests\migrate_tools\KernelCode
public function testFailingRollbackThrowsException() : void {
$this
->expectException(\Exception::class);
$this
->expectExceptionMessage('source_exception migration failed');
/** @var \Drupal\migrate\Plugin\MigrationInterface $migration */
$migration = $this->migrationPluginManager
->createInstance('source_exception');
$migration
->setStatus(MigrationInterface::STATUS_IMPORTING);
$this->commands
->rollback('source_exception', $this->importBaseOptions);
}