public function MigrateHelperTest::testRollback in Panopoly 8.2
Tests the rollback() method.
@covers ::rollback
File
- modules/
panopoly/ panopoly_core/ tests/ src/ Unit/ MigrateHelperTest.php, line 85
Class
- MigrateHelperTest
- Tests for Panopoly Core's MigrateHelper service.
Namespace
Drupal\Tests\panopoly_core\UnitCode
public function testRollback() {
$migration1 = $this
->prophesize(MigrationInterface::class);
$migration2 = $this
->prophesize(MigrationInterface::class);
$ids = [
'migration1',
'migration2',
];
$this->migrationManager
->createInstances(array_reverse($ids))
->willReturn([
$migration1,
$migration2,
]);
$migrate_helper = $this
->getMockBuilder(MigrateHelper::class)
->setConstructorArgs([
$this->migrationManager
->reveal(),
])
->onlyMethods([
'createExecutable',
])
->getMock();
$executable = $this
->prophesize(MigrateExecutableInterface::class);
$executable
->rollback()
->shouldBeCalled();
$migrate_helper
->method('createExecutable')
->willReturn($executable
->reveal());
$migrate_helper
->rollback($ids);
}