function ContentEntityConstructorTest::testConstructor

Same name in other branches
  1. 9 core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/ContentEntityConstructorTest.php \Drupal\Tests\migrate_drupal\Kernel\Plugin\migrate\source\ContentEntityConstructorTest::testConstructor()
  2. 10 core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/ContentEntityConstructorTest.php \Drupal\Tests\migrate_drupal\Kernel\Plugin\migrate\source\ContentEntityConstructorTest::testConstructor()

Tests the constructor.

@dataProvider providerTestConstructor

File

core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/ContentEntityConstructorTest.php, line 35

Class

ContentEntityConstructorTest
Tests the constructor of the entity content source plugin.

Namespace

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

Code

public function testConstructor($configuration, $plugin_definition, $exception_class, $expected) : void {
    $migration = $this->prophesize(MigrationInterface::class)
        ->reveal();
    $this->expectException($exception_class);
    $this->expectExceptionMessage($expected);
    ContentEntity::create($this->container, $configuration, 'content_entity', $plugin_definition, $migration);
}

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