public function ContentEntityTest::testConstructorNonContentEntity in Drupal 8
Same name and namespace in other branches
- 9 core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/ContentEntityTest.php \Drupal\Tests\migrate_drupal\Kernel\Plugin\migrate\source\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\sourceCode
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);
}