You are here

public function EckEntityExceptionTest::testEckEntityCheckRequirements in Entity Construction Kit (ECK) 8

Tests checkRequirements.

File

tests/src/Kernel/Plugin/migrate/source/d7/EckEntityExceptionTest.php, line 39

Class

EckEntityExceptionTest
Tests check requirements for comment type source plugin.

Namespace

Drupal\Tests\eck\Kernel\Plugin\migrate\source

Code

public function testEckEntityCheckRequirements() {
  $this
    ->expectException(RequirementsException::class);
  $this
    ->expectExceptionMessage("ECK table for 'does_not_exist' does not exist");
  $migration = $this
    ->getMigration('d7_eck');
  $definition = $migration
    ->getPluginDefinition();
  $definition['source'] = [
    'plugin' => 'd7_eck_entity',
    'entity_type' => 'does_not_exist',
    'bundle' => 'simple_entity',
  ];
  $migration = $this->migrationPluginManager
    ->createInstance('d7_eck:simple_entity:simple_entity', $definition);
  $migration
    ->getSourcePlugin()
    ->checkRequirements();
}