You are here

public function ExtractTest::testExtractFailDefault in Zircon Profile 8.0

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

Tests unsuccessful extraction.

File

core/modules/migrate/tests/src/Unit/process/ExtractTest.php, line 57
Contains \Drupal\Tests\migrate\Unit\process\ExtractTest.

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, 'destinationproperty');
  $this
    ->assertSame($value, 'test', '');
}