public function EckEntityExceptionTest::testEckEntityConstructor in Entity Construction Kit (ECK) 8
Tests thrown exceptions when node or comment aren't enabled on source.
@dataProvider providerTestEckEntityConstructor
Parameters
mixed $entity_type: The entity type.
mixed $bundle: The bundle.
string $exception_message: The expected exception message.
File
- tests/
src/ Kernel/ Plugin/ migrate/ source/ d7/ EckEntityExceptionTest.php, line 68
Class
- EckEntityExceptionTest
- Tests check requirements for comment type source plugin.
Namespace
Drupal\Tests\eck\Kernel\Plugin\migrate\sourceCode
public function testEckEntityConstructor($entity_type, $bundle, $exception_message) {
$this
->expectException(MigrateException::class);
$this
->expectExceptionMessage($exception_message);
$migration = $this
->getMigration('d7_eck:simple_entity:simple_entity');
$definition = $migration
->getPluginDefinition();
$definition['source'] = [
'plugin' => 'd7_eck_entity',
'entity_type' => $entity_type,
'bundle' => $bundle,
];
$migration = $this->migrationPluginManager
->createInstance('d7_eck:simple_entity:simple_entity', $definition);
$migration
->getSourcePlugin();
}