function ExtractTest::testExtractDefault

Same name in other branches
  1. 9 core/modules/migrate/tests/src/Unit/process/ExtractTest.php \Drupal\Tests\migrate\Unit\process\ExtractTest::testExtractDefault()
  2. 10 core/modules/migrate/tests/src/Unit/process/ExtractTest.php \Drupal\Tests\migrate\Unit\process\ExtractTest::testExtractDefault()

Test the extract plugin with default values.

@dataProvider providerExtractDefault

Parameters

array $value: The process plugin input value.

array $configuration: The plugin configuration.

string|null $expected: The expected transformed value.

Throws

\Drupal\migrate\MigrateException

File

core/modules/migrate/tests/src/Unit/process/ExtractTest.php, line 77

Class

ExtractTest
@coversDefaultClass \Drupal\migrate\Plugin\migrate\process\Extract @group migrate

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function testExtractDefault(array $value, array $configuration, $expected) : void {
    $this->plugin = new Extract($configuration, 'map', []);
    $value = $this->plugin
        ->transform($value, $this->migrateExecutable, $this->row, 'destination_property');
    $this->assertSame($expected, $value);
}

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