You are here

public function ExtractTest::testExtractFailDefault in Drupal 10

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

Tests unsuccessful extraction.

File

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

Class

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

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function testExtractFailDefault() {
  $plugin = new Extract([
    'index' => [
      'foo',
    ],
    'default' => 'test',
  ], 'map', []);
  $value = $plugin
    ->transform([
    'bar' => 'foo',
  ], $this->migrateExecutable, $this->row, 'destination_property');
  $this
    ->assertSame('test', $value, '');
}