You are here

public function ContentEntityTest::testConstructorNotBundable in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/ContentEntityTest.php \Drupal\Tests\migrate_drupal\Kernel\Plugin\migrate\source\ContentEntityTest::testConstructorNotBundable()

Tests the constructor for not bundleable entity.

File

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

Class

ContentEntityTest
Tests the entity content source plugin.

Namespace

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

Code

public function testConstructorNotBundable() {
  $migration = $this
    ->prophesize(MigrationInterface::class)
    ->reveal();
  $configuration = [
    'bundle' => 'foo',
  ];
  $plugin_definition = [
    'entity_type' => 'user',
  ];
  $this
    ->expectException(\InvalidArgumentException::class);
  $this
    ->expectExceptionMessage('A bundle was provided but the entity type (user) is not bundleable');
  ContentEntity::create($this->container, $configuration, 'content_entity:user', $plugin_definition, $migration);
}