function ContentEntityConstructorTest::testConstructor

Same name in other branches
  1. 10 core/modules/migrate_drupal/tests/src/Kernel/Plugin/migrate/source/ContentEntityConstructorTest.php \Drupal\Tests\migrate_drupal\Kernel\Plugin\migrate\source\ContentEntityConstructorTest::testConstructor()
  2. 11.x 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 33

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) {
    $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.