You are here

public function FieldDiscoveryTestTrait::assertSourcePlugin in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/migrate_drupal/tests/src/Traits/FieldDiscoveryTestTrait.php \Drupal\Tests\migrate_drupal\Traits\FieldDiscoveryTestTrait::assertSourcePlugin()

Asserts a migrate source plugin.

Parameters

string $core: The Drupal core version.

string $class: The expected class of the source plugin.

array $expected_definition: The expected source plugin definition.

2 calls to FieldDiscoveryTestTrait::assertSourcePlugin()
FieldDiscoveryTest::testGetSourcePlugin in core/modules/migrate_drupal/tests/src/Kernel/d7/FieldDiscoveryTest.php
Tests the getSourcePlugin method.
FieldDiscoveryTest::testGetSourcePlugin in core/modules/migrate_drupal/tests/src/Kernel/d6/FieldDiscoveryTest.php
Tests the getSourcePlugin method.

File

core/modules/migrate_drupal/tests/src/Traits/FieldDiscoveryTestTrait.php, line 96

Class

FieldDiscoveryTestTrait
Helper functions to test field discovery.

Namespace

Drupal\Tests\migrate_drupal\Traits

Code

public function assertSourcePlugin($core, $class, array $expected_definition) {
  $field_discovery = new FieldDiscoveryTestClass($this->fieldPluginManager, $this->migrationPluginManager, $this->logger);
  $source = $field_discovery
    ->getSourcePlugin($core);
  $this
    ->assertInstanceOf($class, $source);
  $this
    ->assertSame($expected_definition, $source
    ->getPluginDefinition());
}