You are here

public function RestoreDeriverTest::testDeriver in Workbench Moderation to Content Moderation 8.2

File

tests/src/Kernel/Plugin/Deriver/RestoreDeriverTest.php, line 30

Class

RestoreDeriverTest
@covers \Drupal\wbm2cm\Plugin\Deriver\RestoreDeriver @group wbm2cm

Namespace

Drupal\Tests\wbm2cm\Plugin\Deriver

Code

public function testDeriver() {
  $this->container
    ->get('state')
    ->set('moderation_entity_types', [
    'node',
  ]);
  $migration = $this->container
    ->get('plugin.manager.migration')
    ->getDefinition('wbm2cm_restore:node');
  $this
    ->assertEquals('content_entity_revision:node', $migration['source']['plugin']);
  $this
    ->assertEquals('vid', $migration['process']['vid']);
  $this
    ->assertEquals('langcode', $migration['process']['langcode']);
  $lookup = $migration['process']['moderation_state'][0];
  $this
    ->assertEquals([
    'nid',
    'vid',
    'langcode',
  ], $lookup['source']);
  $this
    ->assertEquals([
    'wbm2cm_save:node',
  ], $lookup['migration']);
  $this
    ->assertEquals('entity_revision:node', $migration['destination']['plugin']);
  $this
    ->assertContains('wbm2cm_save:node', $migration['migration_dependencies']['required']);
}