You are here

public function MigrateStubTest::testCreateStubRawReturn in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/migrate/tests/src/Kernel/MigrateStubTest.php \Drupal\Tests\migrate\Kernel\MigrateStubTest::testCreateStubRawReturn()

Tests raw stub creation.

File

core/modules/migrate/tests/src/Kernel/MigrateStubTest.php, line 79

Class

MigrateStubTest
Tests the migrate.stub Service.

Namespace

Drupal\Tests\migrate\Kernel

Code

public function testCreateStubRawReturn() {
  $this
    ->assertSame([], $this->migrateLookup
    ->lookup('sample_stubbing_migration', [
    17,
  ]));
  $ids = $this->migrateStub
    ->createStub('sample_stubbing_migration', [
    17,
  ], [], FALSE);
  $this
    ->assertSame($ids, [
    $this->migrateLookup
      ->lookup('sample_stubbing_migration', [
      17,
    ])[0]['nid'],
  ]);
  $this
    ->assertNotNull(\Drupal::entityTypeManager()
    ->getStorage('node')
    ->load($ids[0]));
}