You are here

protected function DrushTest::setUp in Migrate Upgrade 8.3

Overrides MigrateDrupalTestBase::setUp

File

tests/src/Kernel/DrushTest.php, line 43

Class

DrushTest
Tests the drush command runner for migrate upgrade.

Namespace

Drupal\Tests\migrate_upgrade\Kernel

Code

protected function setUp() : void {

  // Enable all modules.
  self::$modules = array_merge(array_keys($this
    ->coreModuleListDataProvider()), [
    'migrate_plus',
    'migrate_upgrade',
  ]);
  self::$modules = array_diff(self::$modules, [
    'block_place',
  ]);
  parent::setUp();
  $this
    ->installSchema('system', [
    'key_value',
    'key_value_expire',
  ]);
  $this
    ->installConfig(self::$modules);
  $this
    ->installEntitySchema('migration_group');
  $this
    ->installEntitySchema('migration');
  $this->migrationManager = \Drupal::service('plugin.manager.migration');
  $this->state = $this->container
    ->get('state');

  // Mocks the logger channel and factory because drush is not available
  // to use directly, and the Drupal loggers do not implement the "ok"
  // level.
  $loggerProphet = $this
    ->prophesize('\\Drush\\Log\\Logger');
  $loggerFactoryProphet = $this
    ->prophesize('\\Drupal\\Core\\Logger\\LoggerChannelFactoryInterface');
  $loggerFactoryProphet
    ->get('drush')
    ->willReturn($loggerProphet
    ->reveal());
  $this->commands = new MigrateUpgradeCommands($this->state, $loggerFactoryProphet
    ->reveal());
}