function StaticMapTest::testWithEmptyStringMap
Tests when the source returns an empty string and it is mapped to a value.
File
-
core/
modules/ migrate/ tests/ src/ Unit/ process/ StaticMapTest.php, line 144
Class
- StaticMapTest
- Tests the static map process plugin.
Namespace
Drupal\Tests\migrate\Unit\processCode
public function testWithEmptyStringMap() : void {
$configuration['map']['foo']['bar'] = 'baz';
$configuration['map'][''] = 'mapped empty string';
$this->plugin = new StaticMap($configuration, 'map', []);
$value = $this->plugin
->transform('', $this->migrateExecutable, $this->row, 'destination_property');
$this->assertSame('mapped empty string', $value);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.