function MigrateStubTest::testInvalidSourceIdKeys

Same name in other branches
  1. 9 core/modules/migrate/tests/src/Kernel/MigrateStubTest.php \Drupal\Tests\migrate\Kernel\MigrateStubTest::testInvalidSourceIdKeys()
  2. 8.9.x core/modules/migrate/tests/src/Kernel/MigrateStubTest.php \Drupal\Tests\migrate\Kernel\MigrateStubTest::testInvalidSourceIdKeys()
  3. 11.x core/modules/migrate/tests/src/Kernel/MigrateStubTest.php \Drupal\Tests\migrate\Kernel\MigrateStubTest::testInvalidSourceIdKeys()

Tests invalid source ids keys.

File

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

Class

MigrateStubTest
Tests the migrate.stub Service.

Namespace

Drupal\Tests\migrate\Kernel

Code

public function testInvalidSourceIdKeys() : void {
    $this->expectException(\InvalidArgumentException::class);
    $this->expectExceptionMessage("'version_id' is defined as a source ID but has no value.");
    $this->migrateStub
        ->createStub('sample_stubbing_migration_with_multiple_source_ids', [
        'id' => 17,
        'not_a_key' => 17,
    ]);
}

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