You are here

public function MigrateStubTest::testCreateStub in Drupal 9

Same name in this branch
  1. 9 core/modules/migrate/tests/src/Unit/MigrateStubTest.php \Drupal\Tests\migrate\Unit\MigrateStubTest::testCreateStub()
  2. 9 core/modules/migrate/tests/src/Kernel/MigrateStubTest.php \Drupal\Tests\migrate\Kernel\MigrateStubTest::testCreateStub()
Same name and namespace in other branches
  1. 8 core/modules/migrate/tests/src/Kernel/MigrateStubTest.php \Drupal\Tests\migrate\Kernel\MigrateStubTest::testCreateStub()

Tests stub creation.

File

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

Class

MigrateStubTest
Tests the migrate.stub Service.

Namespace

Drupal\Tests\migrate\Kernel

Code

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