function MigrateStubTest::testCreateStubRawReturn

Same name in other branches
  1. 9 core/modules/migrate/tests/src/Kernel/MigrateStubTest.php \Drupal\Tests\migrate\Kernel\MigrateStubTest::testCreateStubRawReturn()
  2. 8.9.x core/modules/migrate/tests/src/Kernel/MigrateStubTest.php \Drupal\Tests\migrate\Kernel\MigrateStubTest::testCreateStubRawReturn()
  3. 11.x 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 81

Class

MigrateStubTest
Tests the migrate.stub Service.

Namespace

Drupal\Tests\migrate\Kernel

Code

public function testCreateStubRawReturn() : void {
    $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]));
}

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