function StaticMapTest::testWithNullSourceDefaultValue

Tests when the source is invalid but default_value is set to TRUE.

File

core/modules/migrate/tests/src/Unit/process/StaticMapTest.php, line 133

Class

StaticMapTest
Tests the static map process plugin.

Namespace

Drupal\Tests\migrate\Unit\process

Code

public function testWithNullSourceDefaultValue() : void {
  $configuration['map']['foo']['bar'] = 'baz';
  $configuration['default_value'] = FALSE;
  $this->plugin = new StaticMap($configuration, 'map', []);
  $value = $this->plugin
    ->transform(NULL, $this->migrateExecutable, $this->row, 'destination_property');
  $this->assertFalse($value);
}

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