public function NullCoalesceTest::testTransformWithDefault in Drupal 8
Same name and namespace in other branches
- 9 core/modules/migrate/tests/src/Unit/process/NullCoalesceTest.php \Drupal\Tests\migrate\Unit\process\NullCoalesceTest::testTransformWithDefault()
Tests null_coalesce with default value.
@covers ::transform
File
- core/
modules/ migrate/ tests/ src/ Unit/ process/ NullCoalesceTest.php, line 84
Class
- NullCoalesceTest
- Tests the null_coalesce process plugin.
Namespace
Drupal\Tests\migrate\Unit\processCode
public function testTransformWithDefault() {
$plugin = new NullCoalesce([
'default_value' => 'default',
], 'null_coalesce', []);
$result = $plugin
->transform([
NULL,
NULL,
'Test',
'Test 2',
], $this->migrateExecutable, $this->row, 'destination_property');
$this
->assertSame('Test', $result);
$this
->assertSame('default', $plugin
->transform([
NULL,
NULL,
], $this->migrateExecutable, $this->row, 'destination_property'));
}