function ContentEntityTest::testConstructorNonContentEntity

Tests the constructor for non content entity.

File

core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/ContentEntityTest.php, line 193

Class

ContentEntityTest
Tests the entity content source plugin.

Namespace

Drupal\Tests\migrate_drupal\Kernel\Plugin\migrate\source

Code

public function testConstructorNonContentEntity() {
  $migration = $this->prophesize(MigrationInterface::class)
    ->reveal();
  $configuration = [];
  $plugin_definition = [
    'entity_type' => 'node_type',
  ];
  $this->expectException(InvalidPluginDefinitionException::class);
  $this->expectExceptionMessage('The entity type (node_type) is not supported. The "content_entity" source plugin only supports content entities.');
  ContentEntity::create($this->container, $configuration, 'content_entity:node_type', $plugin_definition, $migration);
}

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