function MigrateStubTest::testCreateStub

Same name in this branch
  1. 9 core/modules/migrate/tests/src/Unit/MigrateStubTest.php \Drupal\Tests\migrate\Unit\MigrateStubTest::testCreateStub()
Same name in other branches
  1. 8.9.x core/modules/migrate/tests/src/Unit/MigrateStubTest.php \Drupal\Tests\migrate\Unit\MigrateStubTest::testCreateStub()
  2. 8.9.x core/modules/migrate/tests/src/Kernel/MigrateStubTest.php \Drupal\Tests\migrate\Kernel\MigrateStubTest::testCreateStub()
  3. 10 core/modules/migrate/tests/src/Unit/MigrateStubTest.php \Drupal\Tests\migrate\Unit\MigrateStubTest::testCreateStub()
  4. 10 core/modules/migrate/tests/src/Kernel/MigrateStubTest.php \Drupal\Tests\migrate\Kernel\MigrateStubTest::testCreateStub()
  5. 11.x core/modules/migrate/tests/src/Unit/MigrateStubTest.php \Drupal\Tests\migrate\Unit\MigrateStubTest::testCreateStub()
  6. 11.x 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']));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.