function StaticMapTest::testMapWithInvalidSourceAndBypass
Same name in other branches
- 9 core/modules/migrate/tests/src/Unit/process/StaticMapTest.php \Drupal\Tests\migrate\Unit\process\StaticMapTest::testMapWithInvalidSourceAndBypass()
- 8.9.x core/modules/migrate/tests/src/Unit/process/StaticMapTest.php \Drupal\Tests\migrate\Unit\process\StaticMapTest::testMapWithInvalidSourceAndBypass()
- 10 core/modules/migrate/tests/src/Unit/process/StaticMapTest.php \Drupal\Tests\migrate\Unit\process\StaticMapTest::testMapWithInvalidSourceAndBypass()
Tests when the source is invalid and bypass is enabled.
File
-
core/
modules/ migrate/ tests/ src/ Unit/ process/ StaticMapTest.php, line 86
Class
- StaticMapTest
- Tests the static map process plugin.
Namespace
Drupal\Tests\migrate\Unit\processCode
public function testMapWithInvalidSourceAndBypass() : void {
$configuration['map']['foo']['bar'] = 'baz';
$configuration['default_value'] = 'test';
$configuration['bypass'] = TRUE;
$this->plugin = new StaticMap($configuration, 'map', []);
$this->expectException(MigrateException::class);
$this->expectExceptionMessage('Setting both default_value and bypass is invalid.');
$this->plugin
->transform([
'bar',
], $this->migrateExecutable, $this->row, 'destination_property');
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.