public function StaticMapTest::testWithNullSource in Drupal 9
Tests when the source is invalid but there's a default.
File
- core/
modules/ migrate/ tests/ src/ Unit/ process/ StaticMapTest.php, line 106
Class
- StaticMapTest
- Tests the static map process plugin.
Namespace
Drupal\Tests\migrate\Unit\processCode
public function testWithNullSource() {
$configuration['map']['foo']['bar'] = 'baz';
$configuration['map'][NULL] = 'mapped NULL';
$this->plugin = new StaticMap($configuration, 'map', []);
$value = $this->plugin
->transform(NULL, $this->migrateExecutable, $this->row, 'destination_property');
$this
->assertSame('mapped NULL', $value);
}