function FieldDiscoveryTestTrait::assertSourcePlugin

Same name in other branches
  1. 9 core/modules/migrate_drupal/tests/src/Traits/FieldDiscoveryTestTrait.php \Drupal\Tests\migrate_drupal\Traits\FieldDiscoveryTestTrait::assertSourcePlugin()
  2. 8.9.x core/modules/migrate_drupal/tests/src/Traits/FieldDiscoveryTestTrait.php \Drupal\Tests\migrate_drupal\Traits\FieldDiscoveryTestTrait::assertSourcePlugin()
  3. 10 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/d6/FieldDiscoveryTest.php
Tests the getSourcePlugin method.
FieldDiscoveryTest::testGetSourcePlugin in core/modules/migrate_drupal/tests/src/Kernel/d7/FieldDiscoveryTest.php
Tests the getSourcePlugin method.

File

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

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());
}

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